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.

Modelsim error: vlog-2110 illegal refence to net error

Status
Not open for further replies.

hazardcell

Newbie level 3
Joined
Mar 18, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,306
vlog-2110 error

Whenever I try to compile the code in modelsim I get a "vlog-2110 illegal refence to net error" for the lines
Code:
l_prev = l_next;
      r_prev = r_next;
      k_prev = k_next;

basically, I need to run round 16 times (DES) and the value output in l_next from the previous iteration should be the l_prev for the current one. similarly for r_prev and k_prev. However I keep getting that error. I'm a newbie to verilog so please go easy on me :)

Also for some reason "i" never changes, it just remains as 0000 throughout. any help appreciated. thanks in advance

Code:
wire [63:0] r2;
  wire [31:0] l_prev;
  wire [31:0] r_prev;
  wire [55:0] k_prev;
  wire [31:0] l_next;
  wire [31:0] r_next;
  wire [55:0] k_next;

  split3 t1( .r0(r_prev), .r1(l_prev), .x(r2) );
  PC1    t2( .r(k_prev), .x(k) );
  round  t3( .l_prev(l_prev), .l_next(l_next), .r_prev(r_prev), .r_next(r_next), .k_prev(k_prev), .k_next(k_next), .i(i) );

  initial @ ( posedge clk, posedge req )
  begin
    if( req == 1 )
    begin
      m = M;
      k = K;
      i = 4'b0;
    end
  end

  always  @ ( posedge clk, posedge req )
  begin
    if( i < 4'b1111 | i == 4'b1111 )
    begin
      i = i + 1;
      l_prev = l_next;
      r_prev = r_next;
      k_prev = k_next;
    end
  end

Added after 10 minutes:

OK the problem with "i" was a bit stupid. I just forgot to test it with a clock. Still can't figure out the other one though
 

Re: vlog-2110 error

Shouldn't l_prev, r_prev, and k_prev be defined as reg?
 

    hazardcell

    Points: 2
    Helpful Answer Positive Rating
vlog-2110 error

if they were then they wouldn't be accepted as outputs for PC1 and split3
 

vlog-2110 error

So you have multiple things driving those signals? Doesn't seem like a good idea.
 

Re: vlog-2110 error

If I declare l_prev r_prev and k_prev as regs, could I then assign them to the outputs of k_next l_next and r_next?
 

Re: vlog-2110 error

hazardcell said:
If I declare l_prev r_prev and k_prev as regs, could I then assign them to the outputs of k_next l_next and r_next?

no problem
 

    hazardcell

    Points: 2
    Helpful Answer Positive Rating
Re: vlog-2110 error

Managed to get it working. Thanks guys
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top