D
Daku
Guest
Could some Verilog guru please help. I am having trouble assigning
values to component registers of
a concatened register:
I have:
parameter MAX = 50;
parameter DATA_WIDTH = 24;
reg [7 : 0] src;
reg [7 : 0] dst;
reg [7 : 0] pri;
reg [7 : 0] srcchk;
reg [7 : 0] dstchk;
reg [7 : 0] prichk;
reg [7 : 0] testpri;
reg [DATA_WIDTH - 1 : 0] pkt;
reg [DATA_WIDTH - 1 : 0] test;
reg [DATA_WIDTH - 1 : 0] DataArray[MAX - 1 : 0];
reg [MAX - 1:0] indexArray;
initial
begin
num = 0;
head = 0;
tail = 0;
toppriority = 0;
currhipriority = 0;
ispriority = 0;
assign pkt = {src, dst, pri};
assign test = {srcchk, dstchk, prichk};
.......
.......
end
always @ (posedge clock)
begin
/* Some conditions to be satisfied */
pkt = DataArray[head];
pkt[23:16] = 1;
pkt[15:8] = 2;
pkt[7:0] = 8'b00000001;
......
end
always @ (negedge clock)
begin
/* Some conditions to be satisfied */
test = DataArray;
prichk = test[7:0];
$display("%b",prichk);
This print statement always gives xxxxxxxx
This is true even if I have :
test = DataArray;
$display("%b", prichk);
What could the problem be ?
Any hints, suggestions would be greatly appreciated. Thanks in advance
for your help.
values to component registers of
a concatened register:
I have:
parameter MAX = 50;
parameter DATA_WIDTH = 24;
reg [7 : 0] src;
reg [7 : 0] dst;
reg [7 : 0] pri;
reg [7 : 0] srcchk;
reg [7 : 0] dstchk;
reg [7 : 0] prichk;
reg [7 : 0] testpri;
reg [DATA_WIDTH - 1 : 0] pkt;
reg [DATA_WIDTH - 1 : 0] test;
reg [DATA_WIDTH - 1 : 0] DataArray[MAX - 1 : 0];
reg [MAX - 1:0] indexArray;
initial
begin
num = 0;
head = 0;
tail = 0;
toppriority = 0;
currhipriority = 0;
ispriority = 0;
assign pkt = {src, dst, pri};
assign test = {srcchk, dstchk, prichk};
.......
.......
end
always @ (posedge clock)
begin
/* Some conditions to be satisfied */
pkt = DataArray[head];
pkt[23:16] = 1;
pkt[15:8] = 2;
pkt[7:0] = 8'b00000001;
......
end
always @ (negedge clock)
begin
/* Some conditions to be satisfied */
test = DataArray;
prichk = test[7:0];
$display("%b",prichk);
This print statement always gives xxxxxxxx
This is true even if I have :
test = DataArray;
$display("%b", prichk);
What could the problem be ?
Any hints, suggestions would be greatly appreciated. Thanks in advance
for your help.