P
priceless
Guest
If I write a code like this
....
output reg [65:0] packet_wdata ,
....
reg [63:0] hdr ;
reg sob ;
always @(posedge clk200, negedge reset_n)
if (!reset_n)
packet_wdata[63:0] <= 64'd0;
else if (hdr_rden_r[1]) begin
packet_wdata[63:0] <= hdr; // line 1
packet_wdata[63] <= sob; // line 2
...
...
end
else if (pkt_wen_pre2)
packet_wdata[63:0] <= {data_h, mix_doutfifo_rdata[31:0]};
it behaves as expected, with the 63rd bit assigned with the header
value in line #2, overriding the 63 rd bit assignment in line marked
1.
When I ran the synthesis tool, it did not complain, and the
synthesized hardware works ok.
What I would like to know, is this a valid style, I noticed this style
a while ago in Cliff Cummings' paper, now a colleague says it's not a
good practice and other synthesis tools may issue error.
The synthesis tool I used is XST from xilinx (for fpga). Please
discuss your experiences.
Thanks in advance for your answer,
Ash
....
output reg [65:0] packet_wdata ,
....
reg [63:0] hdr ;
reg sob ;
always @(posedge clk200, negedge reset_n)
if (!reset_n)
packet_wdata[63:0] <= 64'd0;
else if (hdr_rden_r[1]) begin
packet_wdata[63:0] <= hdr; // line 1
packet_wdata[63] <= sob; // line 2
...
...
end
else if (pkt_wen_pre2)
packet_wdata[63:0] <= {data_h, mix_doutfifo_rdata[31:0]};
it behaves as expected, with the 63rd bit assigned with the header
value in line #2, overriding the 63 rd bit assignment in line marked
1.
When I ran the synthesis tool, it did not complain, and the
synthesized hardware works ok.
What I would like to know, is this a valid style, I noticed this style
a while ago in Cliff Cummings' paper, now a colleague says it's not a
good practice and other synthesis tools may issue error.
The synthesis tool I used is XST from xilinx (for fpga). Please
discuss your experiences.
Thanks in advance for your answer,
Ash