2017-11-30 22:30:49 +00:00
|
|
|
module rv32_fetch (
|
2017-12-01 18:45:47 +00:00
|
|
|
input clk,
|
2017-11-30 22:30:49 +00:00
|
|
|
|
|
|
|
|
/* data out */
|
2017-12-01 18:45:47 +00:00
|
|
|
output [31:0] pc_out,
|
|
|
|
|
output [31:0] instr_out
|
2017-11-30 22:30:49 +00:00
|
|
|
);
|
|
|
|
|
logic [31:0] instr_mem [255:0];
|
|
|
|
|
logic [31:0] pc;
|
|
|
|
|
|
|
|
|
|
always_ff @(posedge clk) begin
|
|
|
|
|
instr_out <= instr_mem[pc[31:2]];
|
|
|
|
|
pc <= pc + 4;
|
|
|
|
|
pc_out <= pc;
|
|
|
|
|
end
|
|
|
|
|
endmodule
|