📄 minimips.vhd
字号:
-- Asynchronous connexion with the register management and data bypass unit adr_reg1 => adr_reg1, -- Address of the first register operand adr_reg2 => adr_reg2, -- Address of the second register operand use1 => use1, -- Effective use of operand 1 use2 => use2, -- Effective use of operand 2 stop_di => alea, -- Unresolved detected : send nop in the pipeline data1 => data1, -- Operand register 1 data2 => data2, -- Operand register 2 -- Datas from EI stage EI_adr => EI_adr, -- Address of the instruction EI_instr => EI_instr, -- The instruction to decode EI_it_ok => EI_it_ok, -- Allow hardware interruptions -- Synchronous output to EX stage DI_bra => DI_bra, -- Branch decoded DI_link => DI_link, -- A link for that instruction DI_op1 => DI_op1, -- operand 1 for alu DI_op2 => DI_op2, -- operand 2 for alu DI_code_ual => DI_code_ual, -- Alu operation DI_offset => DI_offset, -- Offset for the address calculation DI_adr_reg_dest => DI_adr_reg_dest, -- Address of the destination register of the result DI_ecr_reg => DI_ecr_reg, -- Effective writing of the result DI_mode => DI_mode, -- Address mode (relative to pc or indexed to a register) DI_op_mem => DI_op_mem, -- Memory operation request DI_r_w => DI_r_w, -- Type of memory operation (reading or writing) DI_adr => DI_adr, -- Address of the decoded instruction DI_exc_cause => DI_exc_cause, -- Potential exception detected DI_level => DI_level, -- Availability of the result for the data bypass DI_it_ok => DI_it_ok -- Allow hardware interruptions ); U4_ex : pps_ex port map ( clock => clock, reset => reset, stop_all => stop_all, -- Unconditionnal locking of outputs clear => interrupt, -- Clear the pipeline stage -- Datas from DI stage DI_bra => DI_bra, -- Branch instruction DI_link => DI_link, -- Branch with link DI_op1 => DI_op1, -- Operand 1 for alu DI_op2 => DI_op2, -- Operand 2 for alu DI_code_ual => DI_code_ual, -- Alu operation DI_offset => DI_offset, -- Offset for address calculation DI_adr_reg_dest => DI_adr_reg_dest, -- Destination register address for the result DI_ecr_reg => DI_ecr_reg, -- Effective writing of the result DI_mode => DI_mode, -- Address mode (relative to pc ou index by a register) DI_op_mem => DI_op_mem, -- Memory operation DI_r_w => DI_r_w, -- Type of memory operation (read or write) DI_adr => DI_adr, -- Instruction address DI_exc_cause => DI_exc_cause, -- Potential cause exception DI_level => DI_level, -- Availability stage of the result for bypassing DI_it_ok => DI_it_ok, -- Allow hardware interruptions -- Synchronous outputs to MEM stage EX_adr => EX_adr, -- Instruction address EX_bra_confirm => EX_bra_confirm, -- Branch execution confirmation EX_data_ual => EX_data_ual, -- Ual result EX_adresse => EX_adresse, -- Address calculation result EX_adr_reg_dest => EX_adr_reg_dest, -- Destination register for the result EX_ecr_reg => EX_ecr_reg, -- Effective writing of the result EX_op_mem => EX_op_mem, -- Memory operation needed EX_r_w => EX_r_w, -- Type of memory operation (read or write) EX_exc_cause => EX_exc_cause, -- Potential cause exception EX_level => EX_level, -- Availability stage of result for bypassing EX_it_ok => EX_it_ok -- Allow hardware interruptions ); U5_mem : pps_mem port map ( clock => clock, reset => reset, stop_all => stop_all, -- Unconditionnal locking of the outputs clear => interrupt, -- Clear the pipeline stage -- Interface with the control bus MTC_data => MTC_data, -- Data to write in memory MTC_adr => MTC_adr, -- Address for memory MTC_r_w => MTC_r_w, -- Read/Write in memory MTC_req => MTC_req, -- Request access to memory CTM_data => CTM_data, -- Data from memory -- Datas from Execution stage EX_adr => EX_adr, -- Instruction address EX_data_ual => EX_data_ual, -- Result of alu operation EX_adresse => EX_adresse, -- Result of the calculation of the address EX_adr_reg_dest => EX_adr_reg_dest, -- Destination register address for the result EX_ecr_reg => EX_ecr_reg, -- Effective writing of the result EX_op_mem => EX_op_mem, -- Memory operation needed EX_r_w => EX_r_w, -- Type of memory operation (read or write) EX_exc_cause => EX_exc_cause, -- Potential exception cause EX_level => EX_level, -- Availability stage for the result for bypassing EX_it_ok => EX_it_ok, -- Allow hardware interruptions -- Synchronous outputs for bypass unit MEM_adr => MEM_adr, -- Instruction address MEM_adr_reg_dest=>MEM_adr_reg_dest, -- Destination register address MEM_ecr_reg => MEM_ecr_reg, -- Writing of the destination register MEM_data_ecr => MEM_data_ecr, -- Data to write (from alu or memory) MEM_exc_cause => MEM_exc_cause, -- Potential exception cause MEM_level => MEM_level, -- Availability stage for the result for bypassing MEM_it_ok => MEM_it_ok -- Allow hardware interruptions ); U6_renvoi : renvoi port map ( -- Register access signals adr1 => adr_reg1, -- Operand 1 address adr2 => adr_reg2, -- Operand 2 address use1 => use1, -- Operand 1 utilisation use2 => use2, -- Operand 2 utilisation data1 => data1, -- First register value data2 => data2, -- Second register value alea => alea, -- Unresolved hazards detected -- Bypass signals of the intermediary datas DI_level => DI_level, -- Availability level of the data DI_adr => DI_adr_reg_dest, -- Register destination of the result DI_ecr => DI_ecr_reg, -- Writing register request DI_data => DI_op2, -- Data to used EX_level => EX_level, -- Availability level of the data EX_adr => EX_adr_reg_dest, -- Register destination of the result EX_ecr => EX_ecr_reg, -- Writing register request EX_data => EX_data_ual, -- Data to used MEM_level => MEM_level, -- Availability level of the data MEM_adr => MEM_adr_reg_dest, -- Register destination of the result MEM_ecr => MEM_ecr_reg, -- Writing register request MEM_data => MEM_data_ecr, -- Data to used interrupt => interrupt, -- Exceptions or interruptions -- Connexion to the differents bank of register -- Writing commands for writing in the registers write_data => write_data, -- Data to write write_adr => write_adr, -- Address of the register to write write_GPR => write_GPR, -- Selection in the internal registers write_SCP => write_SCP, -- Selection in the coprocessor system registers -- Reading commands for Reading in the registers read_adr1 => read_adr1, -- Address of the first register to read read_adr2 => read_adr2, -- Address of the second register to read read_data1_GPR => read_data1_GPR, -- Value of operand 1 from the internal registers read_data1_SCP => read_data1_SCP, -- Value of operand 2 from the internal registers read_data2_GPR => read_data2_GPR, -- Value of operand 1 from the coprocessor system registers read_data2_SCP => read_data2_SCP -- Value of operand 2 from the coprocessor system registers ); U7_banc : banc port map( clock => clock, reset => reset, -- Register addresses to read reg_src1 => read_adr1, reg_src2 => read_adr2, -- Register address to write and its data reg_dest => write_adr, donnee => write_data, -- Write signal cmd_ecr => write_GPR, -- Bank outputs data_src1 => read_data1_GPR, data_src2 => read_data2_GPR ); U8_syscop : syscop port map ( clock => clock, reset => reset, -- Datas from the pipeline MEM_adr => MEM_adr, -- Address of the current instruction in the pipeline end -> responsible of the exception MEM_exc_cause => MEM_exc_cause, -- Potential cause exception of that instruction MEM_it_ok => MEM_it_ok, -- Allow hardware interruptions -- Hardware interruption it_mat => it_mat_clk, -- Hardware interruption detected -- Interruption controls interrupt => interrupt, -- Interruption to take into account vecteur_it => vecteur_it, -- Interruption vector -- Writing request in register bank write_data => write_data, -- Data to write write_adr => write_adr, -- Address of the register to write write_SCP => write_SCP, -- Writing request -- Reading request in register bank read_adr1 => read_adr1, -- Address of the first register read_adr2 => read_adr2, -- Address of the second register read_data1 => read_data1_SCP, -- Value of register 1 read_data2 => read_data2_SCP -- Value of register 2 ); U9_bus_ctrl : bus_ctrl port map ( clock => clock, reset => reset, -- Interruption in the pipeline interrupt => interrupt, -- Interface for the Instruction Extraction Stage adr_from_ei => ETC_adr, -- The address of the data to read instr_to_ei => CTE_instr, -- Instruction from the memory -- Interface with the MEMory Stage req_from_mem => MTC_req, -- Request to access the ram r_w_from_mem => MTC_r_w, -- Read/Write request adr_from_mem => MTC_adr, -- Address in ram data_from_mem => MTC_data, -- Data to write in ram data_to_mem => CTM_data, -- Data from the ram to the MEMory stage -- RAM interface signals req_to_ram => ram_req, -- Request to ram adr_to_ram => ram_adr, -- Address of the data to read or write r_w_to_ram => ram_r_w, -- Read/Write request ack_from_ram => ram_ack, -- Acknowledge from the memory data_inout_ram => ram_data, -- Data from/to the memory -- Pipeline progress control signal stop_all => stop_all );end rtl;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -