Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Error when running testbench file by ModelSim

Status
Not open for further replies.

test_out

Advanced Member level 4
Joined
Feb 10, 2006
Messages
103
Helped
5
Reputation
10
Reaction score
1
Trophy points
1,298
Activity points
1,959
How can I solve this?

When I run the testbench file by ModelSim I got this error:

# ** Error: E:/Mem Control/testbench/test_lib.v(82): near "always": expecting: LIBRARY CONFIG

at this code line:

always @(posedge clk)
if(wb_cyc_i) cyc_cnt = cyc_cnt + 1;


How can I solve this?
 

Re: How can I solve this?

Obviously the your want one dff and an adder to do your job.
But the use of "posedge" tell compiler this is a dff.
So, can you put an adder in your dff?
compiler cannot find a dff with an adder in the library.

You may use following codes:

always @(posedge clk)
if(wb_cyc_i)
dout <= cyc_cnt;

always@(dout)
cyc_cnt<=dout+1;
 

Re: How can I solve this?

maybe can try this:

always @(posedge clk)
if(wb_cyc_i) cyc_cnt <= cyc_cnt + 1;
 

Re: How can I solve this?

johnz said:
maybe can try this:

always @(posedge clk)
if(wb_cyc_i) cyc_cnt <= cyc_cnt + 1;

hi,johnz,
Are u sure this can lead to the synthesis of a dff and an adder?
 

How can I solve this?

I think the adder and the DFF should be seperate! I agree the point of laglead.
 

Re: How can I solve this?

laglead said:
johnz said:
maybe can try this:

always @(posedge clk)
if(wb_cyc_i) cyc_cnt <= cyc_cnt + 1;

hi,johnz,
Are u sure this can lead to the synthesis of a dff and an adder?

Hi laglead,
I just want to try another coding,
you can thynthesize it by yourself, take look whether their results are same.
 

How can I solve this?

the segment of your code is correct! it's not the root cause of this problem.
 

Re: How can I solve this?

I dun see any problem with the coding too. It should work with simulations.
Prehaps, you can try to check the syntax.

Cheers
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top