Skip to content

Commit

Permalink
Document and clean up interface of serv_immdec
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Dec 29, 2020
1 parent 14cbe03 commit ca1a07f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
11 changes: 11 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ serv_decode is responsible for decoding the operation word coming from ibus into

.. image:: serv_decode_int.png

serv_immdec
^^^^^^^^^^^

.. image:: serv_immdec.png

The main responsibility of serv_immdec is to stitch together the pieces of immediates from the instruction word and push it out in the correct order. When a new instruction arrives, the relevant parts are placed into a number of shift registers, and the connections between the registers are setup differently depending on the type of operation.

serv_immdec also extracts the register addresses from the operation word.

.. image:: serv_immdec_int.png

serv_mem_if
^^^^^^^^^^^

Expand Down
Binary file added doc/serv_immdec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/serv_immdec_int.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions rtl/serv_immdec.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
module serv_immdec
(
input wire i_clk,
//Input
//State
input wire i_cnt_en,
input wire i_csr_imm_en,
output wire o_csr_imm,
input wire [31:2] i_wb_rdt,
input wire i_wb_en,
input wire i_cnt_done,
//Control
input wire i_csr_imm_en,
input wire [3:0] i_ctrl,
//To RF
output wire [4:0] o_rd_addr,
output wire [4:0] o_rs1_addr,
output wire [4:0] o_rs2_addr,
output wire o_imm);
//Data
output wire o_csr_imm,
output wire o_imm,
//External
input wire i_wb_en,
input wire [31:7] i_wb_rdt);

reg signbit;

Expand Down
27 changes: 15 additions & 12 deletions rtl/serv_top.v
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,22 @@ module serv_top

serv_immdec immdec
(
.i_clk (clk),
.i_cnt_en (cnt_en),
.i_clk (clk),
//State
.i_cnt_en (cnt_en),
.i_cnt_done (cnt_done),
//Control
.i_csr_imm_en (csr_imm_en),
.o_csr_imm (csr_imm),
.i_wb_rdt (i_ibus_rdt[31:2]),
.i_wb_en (i_ibus_ack),
.i_ctrl (immdec_ctrl),
.i_cnt_done (cnt_done),
//To RF
.o_rd_addr (rd_addr),
.o_rs1_addr (rs1_addr),
.o_rs2_addr (rs2_addr),
.o_imm (imm));
.i_ctrl (immdec_ctrl),
.o_rd_addr (rd_addr),
.o_rs1_addr (rs1_addr),
.o_rs2_addr (rs2_addr),
//Data
.o_csr_imm (csr_imm),
.o_imm (imm),
//External
.i_wb_en (i_ibus_ack),
.i_wb_rdt (i_ibus_rdt[31:7]));

serv_bufreg bufreg
(
Expand Down

0 comments on commit ca1a07f

Please sign in to comment.