jinics
Member level 2
Hi,
I want to extract variable bits from an incoming data stream. I want something like this:
Method1:
parameter MAX = 16
reg [3:0] reg1;
//reg1 is assigned the value from some register
[MAX-1:0] extracted_bits = stream_data [reg1 - 1:0]
Method2:
Since verilog does no allow variables in here.
One way to do is that I use parameters instead of reg1. i.e.
parameter MAX = 16
parameter reg1 = 5;//some value
[MAX-1:0] extracted_bits = stream_data [reg1 - 1 : 0]
This second method means that every time I want to extract another bit pattern I need to synthesize the code.
Is it possible to extract variable bits as shown in method one.
I want to change the bit selection.
I want to be able to extract variable bits from each incoming chunk based on a variable in register.
Is there some core available which can perform this or can you point me to some technique to do it efficiently.
Thanks,
jinics
I want to extract variable bits from an incoming data stream. I want something like this:
Method1:
parameter MAX = 16
reg [3:0] reg1;
//reg1 is assigned the value from some register
[MAX-1:0] extracted_bits = stream_data [reg1 - 1:0]
Method2:
Since verilog does no allow variables in here.
One way to do is that I use parameters instead of reg1. i.e.
parameter MAX = 16
parameter reg1 = 5;//some value
[MAX-1:0] extracted_bits = stream_data [reg1 - 1 : 0]
This second method means that every time I want to extract another bit pattern I need to synthesize the code.
Is it possible to extract variable bits as shown in method one.
I want to change the bit selection.
I want to be able to extract variable bits from each incoming chunk based on a variable in register.
Is there some core available which can perform this or can you point me to some technique to do it efficiently.
Thanks,
jinics