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)
How to people write generic register files, if they dont know the size and number of register before hand without priority logic?
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: