summaryrefslogtreecommitdiff
path: root/hdl/top.sv
diff options
context:
space:
mode:
authorJulian Blake Kongslie2021-04-05 10:19:01 -0700
committerJulian Blake Kongslie2021-04-05 10:19:01 -0700
commit0bf6ec12c73e9f037de6b35bb08d94dfe9c6045c (patch)
tree3be7981a9b5c9440e953a99c6f72b1c459b67fc3 /hdl/top.sv
parentRemove some old debug messages. (diff)
downloadnoncpu-0bf6ec12c73e9f037de6b35bb08d94dfe9c6045c.tar.xz
Make PC ADDR-sized rather than DATA-sized for now
Diffstat (limited to '')
-rw-r--r--hdl/top.sv6
1 files changed, 3 insertions, 3 deletions
diff --git a/hdl/top.sv b/hdl/top.sv
index 2615db8..34b9769 100644
--- a/hdl/top.sv
+++ b/hdl/top.sv
@@ -64,7 +64,7 @@ jtag_uart
64 , .tx_data(tx_data) 64 , .tx_data(tx_data)
65 ); 65 );
66 66
67bit [DATA_BITS-1:0] pc; 67bit [ADDR_BITS-1:0] pc;
68bit [3:0] opcode; 68bit [3:0] opcode;
69bit [7:0] operand; 69bit [7:0] operand;
70bit [DATA_BITS-1:0] acc; 70bit [DATA_BITS-1:0] acc;
@@ -97,7 +97,7 @@ always_ff @(posedge clk) begin
97 case (state) 97 case (state)
98 FETCH: begin 98 FETCH: begin
99 mem_valid = 1; 99 mem_valid = 1;
100 mem_address = {2'b0, pc}; 100 mem_address_ = pc;
101 mem_write = 0; 101 mem_write = 0;
102 if (`mem_ready) begin 102 if (`mem_ready) begin
103 state = DECODE; 103 state = DECODE;
@@ -157,7 +157,7 @@ always_ff @(posedge clk) begin
157 mem_write = 0; 157 mem_write = 0;
158 end 158 end
159 if (`mem_read_valid) begin 159 if (`mem_read_valid) begin
160 address = `mem_read_data; 160 address = {{(ADDR_BITS - DATA_BITS){1'b0}}, `mem_read_data};
161 state = AGEN; 161 state = AGEN;
162 end 162 end
163 end 163 end