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.

generic case statement (scalable)

Status
Not open for further replies.

verilog2vhdl

Newbie level 6
Joined
Oct 22, 2007
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,350
This is in a generic register file generation and I have this code, when I synthesize, im getting a priority encode decoder. Is there any way I can avoid priority encoder/decoder for for loop? Else is there any way I can have a case statement which is scalable (dont know how many case expressions will be there beforehand)


Code dot - [expand]
1
2
3
4
5
6
7
8
9
10
11
1 for( int ii = 0; ii < MAX_REGISTERS; ii++ ) begin : register_loop$
  2   if( valid && ii == addr[ADDR_WIDTH-1:0] ) begin$
  3     if( cmd ) begin$
  4        // read register$
  5        read_data <= register[ii];$
  6     else$
  7       // write register$
  8       register[ii] <= write_data;$
  9     end$
 10   end$
 11 end$



How to people write generic register files, if they dont know the size and number of register before hand without priority logic?
 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top