From 0bf6ec12c73e9f037de6b35bb08d94dfe9c6045c Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Mon, 5 Apr 2021 10:19:01 -0700 Subject: Make PC ADDR-sized rather than DATA-sized for now --- hdl/top.sv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hdl/top.sv') 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 , .tx_data(tx_data) ); -bit [DATA_BITS-1:0] pc; +bit [ADDR_BITS-1:0] pc; bit [3:0] opcode; bit [7:0] operand; bit [DATA_BITS-1:0] acc; @@ -97,7 +97,7 @@ always_ff @(posedge clk) begin case (state) FETCH: begin mem_valid = 1; - mem_address = {2'b0, pc}; + mem_address_ = pc; mem_write = 0; if (`mem_ready) begin state = DECODE; @@ -157,7 +157,7 @@ always_ff @(posedge clk) begin mem_write = 0; end if (`mem_read_valid) begin - address = `mem_read_data; + address = {{(ADDR_BITS - DATA_BITS){1'b0}}, `mem_read_data}; state = AGEN; end end -- cgit v1.2.3