From ddae7f9332db19d0987aec553e8375755c747d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Jacquot?= Date: Tue, 5 Mar 2019 06:26:33 +0100 Subject: [PATCH] start implementing block Axx --- saturn_inst_decoder.v | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/saturn_inst_decoder.v b/saturn_inst_decoder.v index 0e7f4ef..aa01acf 100644 --- a/saturn_inst_decoder.v +++ b/saturn_inst_decoder.v @@ -135,9 +135,12 @@ reg [0:0] block_80x; reg [0:0] block_80Cx; reg [0:0] block_82x; reg [0:0] block_84x_85x; +reg [0:0] block_Ax; +reg [0:0] block_Axx; reg [0:0] block_JUMP; reg [0:0] block_LOAD; +reg [0:0] block_FIELDS; /* * temporary variables @@ -180,9 +183,12 @@ initial begin block_80Cx = 1'b0; block_82x = 1'b0; block_84x_85x = 1'b0; + block_Ax = 1'b0; + block_Axx = 1'b0; block_JUMP = 1'b0; block_LOAD = 1'b0; + block_FIELDS = 1'b0; /* local variables */ jump_counter = 3'd0; @@ -240,6 +246,11 @@ always @(posedge i_clk) begin block_JUMP <= 1'b1; end 4'h8: block_8x <= 1'b1; + 4'hA: + begin + block_Ax <= 1'b1; + block_FIELDS <= 1'b1; + end default: begin $display("invalid instruction"); @@ -433,6 +444,19 @@ always @(posedge i_clk) begin block_84x_85x <= 1'b0; end + if (block_Ax) begin + $display("DECODER %0d: [%d] block_Ax %h", i_phase, i_cycle_ctr, i_nibble); + /* work here is done by the block_FIELDS */ + block_Axx <= 1'b1; + block_Ax <= 1'b0; + end + + if (block_Axx) begin + $display("DECODER %0d: [%d] block_Axx %h", i_phase, i_cycle_ctr, i_nibble); + o_decoder_error <= 1'b1; + block_Axx <= 1'b0; + end + /* special cases */ if (block_JUMP) begin @@ -455,6 +479,11 @@ always @(posedge i_clk) begin end end + if (block_FIELDS) begin + $display("DECODER %0d: [%d] block_FIELDS %h", i_phase, i_cycle_ctr, i_nibble); + block_FIELDS <= 1'b0; + end + end /* need to increment this at the same time the pointer is used */ @@ -507,9 +536,12 @@ always @(posedge i_clk) begin block_80Cx <= 1'b0; block_82x <= 1'b0; block_84x_85x <= 1'b0; + block_Ax <= 1'b0; + block_Axx <= 1'b0; block_JUMP <= 1'b0; block_LOAD <= 1'b0; + block_FIELDS <= 1'b0; /* local variables */ jump_counter <= 3'd0;