Chip-DSi / simple_processor_BUET

A simple processor design and verification
Apache License 2.0
1 stars 0 forks source link

Instruction Decoder #21

Open foez-ahmed opened 5 days ago

foez-ahmed commented 5 days ago

The IOs of the instruction decoder should be something like this:

module instruction_decoder (
  input  logic [15:0] code_i,
  output func_t       func_o,
  output logic         we_o,
  output logic [2:0]  rd_addr_o,
  output logic [2:0]  rs1_addr_o,
  output logic [2:0]  rs2_addr_o,
  output logic [31:0] imm_o
);
anindyakchoudhury commented 4 days ago

Is immediate a 32-bit value coming out of ID? or is it a 6-bit value? Because IMEM stores 16 bit of instructions_width. IMM is not stored in any kind of memory either and comes from the user input.

image

foez-ahmed commented 3 days ago

Yes, please convert it to a 32bit signed number before sending it to muxing with rs2

anindyakchoudhury commented 3 days ago

Bhaiya, when instr_t is used? @foez-ahmed

foez-ahmed commented 3 days ago

instr_t is now func_t