B
bir
Guest
I have piece of rtl in fifo.
if (write_en && !read_en && !full)
begin
fifo_reg [write_ptr] <= data_in;
write_ptr<= write_ptr+ 1;
ptr_gap <=ptr_gap + 1;
end
elseif (!write_en && read_en && !empty)
begin
data_out <= fifo[read_ptr];
read_ptr <= read_ptr+ 1;
ptr_gap <= ptr_gap -1;
end
........
.......
can I use a casex statement instead?
casex (write_en, read_en, full, empty)
begin
100x: begin
fifo_reg [write_ptr] <= data_in;
write_ptr<= write_ptr+ 1;
ptr_gap <=ptr_gap + 1;
end
01x0: begin
data_out <= fifo[read_ptr];
read_ptr <= read_ptr+ 1;
ptr_gap <= ptr_gap -1;
end
.......
endcase
Is this rtl synthesizable??
if (write_en && !read_en && !full)
begin
fifo_reg [write_ptr] <= data_in;
write_ptr<= write_ptr+ 1;
ptr_gap <=ptr_gap + 1;
end
elseif (!write_en && read_en && !empty)
begin
data_out <= fifo[read_ptr];
read_ptr <= read_ptr+ 1;
ptr_gap <= ptr_gap -1;
end
........
.......
can I use a casex statement instead?
casex (write_en, read_en, full, empty)
begin
100x: begin
fifo_reg [write_ptr] <= data_in;
write_ptr<= write_ptr+ 1;
ptr_gap <=ptr_gap + 1;
end
01x0: begin
data_out <= fifo[read_ptr];
read_ptr <= read_ptr+ 1;
ptr_gap <= ptr_gap -1;
end
.......
endcase
Is this rtl synthesizable??