9086/cpu/memory.v

11 lines
307 B
Coq
Raw Normal View History

module rom(input [19:0] address,output wire [15:0] data ,input rd,input cs);
reg [15:0] memory [0:599];
initial begin
string boot_code;
if(!$value$plusargs("BOOT_CODE=%s",boot_code))
boot_code="boot_code.txt";
$readmemh(boot_code, memory);
end
assign data = !rd & !cs ? memory[address]: 'hz;
endmodule