diff options
author | Nick McKinney <nick@kmonkey.net> | 2016-12-29 21:34:31 -0600 |
---|---|---|
committer | Nick McKinney <nick@kmonkey.net> | 2016-12-29 21:34:31 -0600 |
commit | 44e4cb4cc79b169c7dbbcbdaf9789cef2548a915 (patch) | |
tree | 1b4a1a42dd74d8654c7ce585c621861f70797a37 /fetch_stage.v | |
parent | 5d3e120708eaf41ddad4ce9fd049a95b0577e399 (diff) |
add containing SoC module, pull test program memory out of CPU
Diffstat (limited to 'fetch_stage.v')
-rw-r--r-- | fetch_stage.v | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/fetch_stage.v b/fetch_stage.v index 749927b..8e78a54 100644 --- a/fetch_stage.v +++ b/fetch_stage.v @@ -1,14 +1,28 @@ module fetch_stage ( input clk, input en, - output reg ready, - + input [15:0] addr_in, + output mem_re, + output [15:0] mem_addr, + input [15:0] mem_data, output reg [15:0] instr_out, output reg [15:0] pc_out ); + assign mem_re = en; + + always @(posedge clk) begin + if(en) begin + instr_out <= mem_data; + pc_out <= addr_in; + end + end + + assign mem_addr = addr_in; + +/* always @(posedge clk) begin if(en) begin ready <= 1'b1; @@ -45,5 +59,6 @@ module fetch_stage ( ready <= 1'b0; end end +*/ endmodule |