ROM, RAM, and FIFO
Describe memories that tools can recognize and handle FIFO boundaries correctly.
A ROM can be described with a case statement
A small constant table is easy to describe with a combinational block. Every address must produce a value.
module opcode_rom (
input wire [2:0] i_address,
output reg [7:0] o_data
);
always @* begin
case (i_address)
3'd0: o_data = 8'h13;
3'd1: o_data = 8'h27;
3'd2: o_data = 8'h42;
3'd3: o_data = 8'h81;
3'd4: o_data = 8'hA5;
default: o_data = 8'h00;
endcase
end
endmoduleDepending on its size and the target FPGA, the tool may implement this table with distributed logic or internal memory.