// // decode.C // // Description: // Implements decode stage of the AD-MIPS pipeline. // // Version: // $Id$ // // Revision: // $Log$ // // Author: // Brian J. Alliet // Jonathon W. Donaldson // #include "includes.h" void decode() { StorageObject& pc = imem.MAR(); StorageObject& ex_mem_aluout = dmem.MAR(); // FEATURE: Remove LMD? // when reading a register currently being written back // (we sort of just create the wires to allow the xfer of the value // b/c arch doesn't allow us to do a write in the 1st half of a clock tick // and a read in the 2nd half as a real register file would) id_reg_rs_bus.IN().pullFrom(*forward(RS(if_id_ir),regs[RS(if_id_ir)],2/*WB*/)); id_reg_rt_bus.IN().pullFrom(*forward(RT(if_id_ir),regs[RT(if_id_ir)],2/*WB*/)); id_ex_rs.latchFrom(id_reg_rs_bus.OUT()); id_ex_rt.latchFrom(id_reg_rt_bus.OUT()); // FEATURE: copyVia(bus,reg,reg); // copy registers to next stage id_imm_bus.IN().pullFrom(if_id_ir); id_ex_imm.latchFrom(id_imm_bus.OUT()); id_ex_uimm.latchFrom(id_imm_bus.OUT()); // copy shift amt to next stage id_shamt_bus.IN().pullFrom(if_id_ir); id_ex_shamt.latchFrom(id_shamt_bus.OUT()); // connect NPS to adder for branch offset calculation id_npc_bus.IN().pullFrom(if_id_npc); // copy NPC to next stage id_onpc_bus.IN().pullFrom(if_id_npc); id_ex_onpc.latchFrom(id_onpc_bus.OUT()); // copy IR to next stage id_ir_bus.IN().pullFrom(if_id_ir); id_ex_ir.latchFrom(id_ir_bus.OUT()); // setup superbus id_branch_off_bus.IN().pullFrom(if_id_ir); id_jump_target_bus.IN().pullFrom(if_id_ir); }