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.

[SOLVED] verilog: how to find max value in the bus

Status
Not open for further replies.

miskod

Newbie level 4
Joined
Sep 16, 2014
Messages
5
Helped
2
Reputation
4
Reaction score
2
Trophy points
3
Activity points
44
Please help me...I'm fighting with following problem in the simulation testbench:
I have bus of 32*10bit values: ix_puldata[319:0]. I need to find maximum value in this bus. I use following code enclosed in the task:

integer j;
….
for(j=0;j<32;j=j+1)
if(top_inst.core.subsystem.ixpul_data[((j+1)*10)-1:(j*10)] > ix_pul_max)
ix_pul_max = top_inst.core.subsystem.ixpul_data[((j+1)*10)-1:(j*10)];

What I get is “Illegal operand for constant expression” everywhere I use “j” integer in array position.
I can imagine, that such code is not synthesizable, but I don’t see reason why it generate error in simulation.
Please, help me to find max value there...
 

  • Like
Reactions: miskod

    miskod

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top