SystemVerolog Problem with VCS

Status
Not open for further replies.

aspirinnnnn

Member level 1
Joined
Jan 4, 2012
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Beijing,China
jetyoung.72pines.com
Activity points
1,511
I had this code downloaded from internet ,and I want to run it with VCS ,but encounter such error:

Error-[INIPL] Identifier not in port list
Identifier 'ha_if' does not appear in port list.
"half_adder_if.sv", 23
Source info: half_adder_if ha_if;

the original code is shown below:
Code:
`ifndef _HALF_ADDER_IF_SV_
`define _HALF_ADDER_IF_SV_
interface half_adder_if;
	logic a,b;
	logic sum;
	logic carry;
endinterface 

module half_adder(half_adder_if ha_if);
	assign ha_if.sum	=	ha_if.a ^ ha_if.b;
	assign ha_if.carray =	ha_if.b & ha_if.b;
endmodule

module tb;
	logic clk;
	half_adder_if ha_if;
	half_adder u1(.ha_if(ha_if));

	initial begin
		clk=1;
		forever #10 clk=~clk;
	end
	initial begin
		ha_if.a<=0;ha_if.b<=0;
		@(posedge clk) ha_if.a =0 ; ha_if.b=1;
		@(posedge clk) ha_if.a =1 ; ha_if.b=0;
		@(posedge clk) ha_if.a =1 ; ha_if.b=1;
		@(posedge clk) $finish;
	end

endmodule




`endif

This seems a rather simple example, i don't know where went wrong
I run it with the following comand :
Code:
VCS +v2k -severilog -debug_all half_adder_if.sv
 

why dont you switch to verilog instead of system verilog and then try to compile. I dont see any advantage using system verilog to test an adder.
 

I am learning systemverilog ,so I started with a simple one.
BTW, I found where i was wrong. the Instantiation of the interface should wrote like :
Code:
half_adder_if ha_if();
but not
Code:
]half_adder_if ha_if
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…