1 |
2 |
dimamali |
/******************************************************************
|
2 |
|
|
* *
|
3 |
|
|
* Author: Liwei *
|
4 |
|
|
* *
|
5 |
|
|
* This file is part of the "mips789" project. *
|
6 |
|
|
* Downloaded from: *
|
7 |
|
|
* http://www.opencores.org/pdownloads.cgi/list/mips789 *
|
8 |
|
|
* *
|
9 |
|
|
* If you encountered any problem, please contact me via *
|
10 |
|
|
* Email:mcupro@opencores.org or mcupro@163.com *
|
11 |
|
|
* *
|
12 |
|
|
******************************************************************/
|
13 |
|
|
|
14 |
|
|
`include "mips789_defs.v"
|
15 |
|
|
|
16 |
|
|
module cal_cpi ( //just used to calculate CPI(Cycles Per Instruction) for stimulation
|
17 |
|
|
input clk,
|
18 |
|
|
input rst,
|
19 |
|
|
input is_nop,
|
20 |
|
|
output reg [100:0] ins_no,
|
21 |
|
|
output reg [100:0] clk_no);
|
22 |
|
|
|
23 |
|
|
always @(posedge clk )
|
24 |
|
|
if (~rst )clk_no=0;
|
25 |
|
|
else
|
26 |
|
|
clk_no = 1+clk_no;
|
27 |
|
|
|
28 |
|
|
always @(posedge clk )
|
29 |
|
|
if (~rst )ins_no=0;
|
30 |
|
|
else if (~is_nop)
|
31 |
|
|
ins_no = 1+ins_no;
|
32 |
|
|
endmodule
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
module add32(
|
36 |
|
|
input [31:0]d_i,
|
37 |
|
|
output [31:0]d_o
|
38 |
|
|
);
|
39 |
|
|
assign d_o = d_i + 4;
|
40 |
|
|
endmodule
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
module jack(
|
44 |
|
|
input [31:0] ins_i ,
|
45 |
|
|
output [4:0] rs_o,
|
46 |
|
|
output [4:0] rt_o,
|
47 |
|
|
output [4:0] rd_o
|
48 |
|
|
);
|
49 |
|
|
assign rs_o = ins_i[25:21];
|
50 |
|
|
assign rt_o = ins_i[20:16];
|
51 |
|
|
assign rd_o = ins_i[15:11];
|
52 |
|
|
endmodule
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
module wb_mux(
|
57 |
|
|
input [31:0]alu_i,
|
58 |
|
|
input [31:0]dmem_i,
|
59 |
|
|
input sel,
|
60 |
|
|
output [31:0]wb_o
|
61 |
|
|
);
|
62 |
|
|
|
63 |
|
|
assign wb_o = (sel==`WB_MEM)?dmem_i:alu_i;
|
64 |
|
|
|
65 |
|
|
endmodule
|
66 |
|
|
|
67 |
|
|
module or32(
|
68 |
|
|
input [31:0]a,
|
69 |
|
|
input [31:0]b,
|
70 |
|
|
output [31:0]c
|
71 |
|
|
);
|
72 |
|
|
|
73 |
|
|
assign c = a|b ;
|
74 |
|
|
|
75 |
|
|
endmodule
|
76 |
|
|
|
77 |
|
|
module rd_sel(
|
78 |
|
|
input [4:0]rd_i,
|
79 |
|
|
input [4:0]rt_i,
|
80 |
|
|
input[1:0] ctl,
|
81 |
|
|
output reg [4:0]rd_o
|
82 |
|
|
);
|
83 |
|
|
|
84 |
|
|
always @(*)
|
85 |
|
|
case (ctl)
|
86 |
|
|
`RD_RD:rd_o=rd_i;
|
87 |
|
|
`RD_RT:rd_o=rt_i;
|
88 |
|
|
`RD_R31:rd_o='d31;
|
89 |
|
|
default :
|
90 |
|
|
rd_o=0;
|
91 |
|
|
endcase
|
92 |
|
|
endmodule
|
93 |
|
|
/*
|
94 |
|
|
|
95 |
|
|
module dly3clk(
|
96 |
|
|
input r1_i,
|
97 |
|
|
output reg r1_o,
|
98 |
|
|
input clk,
|
99 |
|
|
input rst
|
100 |
|
|
);
|
101 |
|
|
reg r1_r,r1_rr;
|
102 |
|
|
|
103 |
|
|
always@(posedge clk)
|
104 |
|
|
if(rst)r1_r<=0;
|
105 |
|
|
else r1_r<=r1_i;
|
106 |
|
|
|
107 |
|
|
always@(posedge clk)
|
108 |
|
|
if(rst)r1_rr<=0;
|
109 |
|
|
else r1_rr<=r1_r;
|
110 |
|
|
|
111 |
|
|
always@(posedge clk)
|
112 |
|
|
if(rst)r1_o<=0;
|
113 |
|
|
else r1_o<=r1_rr;
|
114 |
|
|
|
115 |
|
|
endmodule */
|
116 |
|
|
|
117 |
|
|
//these modules below are genated automaticly by a software written in C language...
|
118 |
|
|
//Some of these may not be used
|
119 |
|
|
|
120 |
|
|
module ext_ctl_reg_clr_cls(input[`EXT_CTL_LEN-1:0] ext_ctl_i,output reg[`EXT_CTL_LEN-1:0] ext_ctl_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) ext_ctl_o<=0;else if(cls)ext_ctl_o<=ext_ctl_o;else ext_ctl_o<=ext_ctl_i; end else ; endmodule
|
121 |
|
|
module rd_sel_reg_clr_cls(input[`RD_SEL_LEN-1:0] rd_sel_i,output reg[`RD_SEL_LEN-1:0] rd_sel_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) rd_sel_o<=0;else if(cls)rd_sel_o<=rd_sel_o;else rd_sel_o<=rd_sel_i;end else ;endmodule
|
122 |
|
|
module cmp_ctl_reg_clr_cls(input[`CMP_CTL_LEN-1:0] cmp_ctl_i,output reg[`CMP_CTL_LEN-1:0] cmp_ctl_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) cmp_ctl_o<=0;else if(cls)cmp_ctl_o<=cmp_ctl_o;else cmp_ctl_o<=cmp_ctl_i;end else ;endmodule
|
123 |
|
|
module pc_gen_ctl_reg_clr_cls(input[`PC_GEN_CTL_LEN-1:0] pc_gen_ctl_i,output reg[`PC_GEN_CTL_LEN-1:0] pc_gen_ctl_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) pc_gen_ctl_o<=0;else if(cls)pc_gen_ctl_o<=pc_gen_ctl_o;else pc_gen_ctl_o<=pc_gen_ctl_i;end else ;endmodule
|
124 |
|
|
module fsm_ctl_reg_clr_cls(input[`FSM_CTL_LEN-1:0] fsm_ctl_i,output reg[`FSM_CTL_LEN-1:0] fsm_ctl_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) fsm_ctl_o<=0;else if(cls)fsm_ctl_o<=fsm_ctl_o;else fsm_ctl_o<=fsm_ctl_i;end else ;endmodule
|
125 |
|
|
module muxa_ctl_reg_clr_cls(input[`MUXA_CTL_LEN-1:0] muxa_ctl_i,output reg[`MUXA_CTL_LEN-1:0] muxa_ctl_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) muxa_ctl_o<=0;else if(cls)muxa_ctl_o<=muxa_ctl_o;else muxa_ctl_o<=muxa_ctl_i;end else ;endmodule
|
126 |
|
|
module muxb_ctl_reg_clr_cls(input[`MUXB_CTL_LEN-1:0] muxb_ctl_i,output reg[`MUXB_CTL_LEN-1:0] muxb_ctl_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) muxb_ctl_o<=0;else if(cls)muxb_ctl_o<=muxb_ctl_o;else muxb_ctl_o<=muxb_ctl_i;end else ;endmodule
|
127 |
|
|
module alu_func_reg_clr_cls(input[`ALU_FUNC_LEN-1:0] alu_func_i,output reg[`ALU_FUNC_LEN-1:0] alu_func_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) alu_func_o<=0;else if(cls)alu_func_o<=alu_func_o;else alu_func_o<=alu_func_i;end else ;endmodule
|
128 |
|
|
module alu_we_reg_clr_cls(input[`ALU_WE_LEN-1:0] alu_we_i,output reg[`ALU_WE_LEN-1:0] alu_we_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) alu_we_o<=0;else if(cls)alu_we_o<=alu_we_o;else alu_we_o<=alu_we_i;end else ;endmodule
|
129 |
|
|
module dmem_ctl_reg_clr_cls(input[`DMEM_CTL_LEN-1:0] dmem_ctl_i,output reg[`DMEM_CTL_LEN-1:0] dmem_ctl_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) dmem_ctl_o<=0;else if(cls)dmem_ctl_o<=dmem_ctl_o;else dmem_ctl_o<=dmem_ctl_i;end else ;endmodule
|
130 |
|
|
module wb_mux_ctl_reg_clr_cls(input[`WB_MUX_CTL_LEN-1:0] wb_mux_ctl_i,output reg[`WB_MUX_CTL_LEN-1:0] wb_mux_ctl_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) wb_mux_ctl_o<=0;else if(cls)wb_mux_ctl_o<=wb_mux_ctl_o;else wb_mux_ctl_o<=wb_mux_ctl_i;end else ;endmodule
|
131 |
|
|
module wb_we_reg_clr_cls(input[`WB_WE_LEN-1:0] wb_we_i,output reg[`WB_WE_LEN-1:0] wb_we_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) wb_we_o<=0;else if(cls)wb_we_o<=wb_we_o;else wb_we_o<=wb_we_i;end else ;endmodule
|
132 |
|
|
module ins_reg_clr_cls(input[`INS_LEN-1:0] ins_i,output reg[`INS_LEN-1:0] ins_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) ins_o<=0;else if(cls)ins_o<=ins_o;else ins_o<=ins_i;end else ;endmodule
|
133 |
|
|
module pc_reg_clr_cls(input[`PC_LEN-1:0] pc_i,output reg[`PC_LEN-1:0] pc_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) pc_o<=0;else if(cls)pc_o<=pc_o;else pc_o<=pc_i;end else ;endmodule
|
134 |
|
|
module spc_reg_clr_cls(input[`SPC_LEN-1:0] spc_i,output reg[`SPC_LEN-1:0] spc_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(clr) spc_o<=0;else if(cls)spc_o<=spc_o;else spc_o<=spc_i;endmodule
|
135 |
|
|
module r1_reg_clr_cls(input[`R1_LEN-1:0] r1_i,output reg[`R1_LEN-1:0] r1_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) r1_o<=0;else if(cls)r1_o<=r1_o;else r1_o<=r1_i;end else ;endmodule
|
136 |
|
|
module r2_reg_clr_cls(input[`R2_LEN-1:0] r2_i,output reg[`R2_LEN-1:0] r2_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) r2_o<=0;else if(cls)r2_o<=r2_o;else r2_o<=r2_i;end else ;endmodule
|
137 |
|
|
module r3_reg_clr_cls(input[`R3_LEN-1:0] r3_i,output reg[`R3_LEN-1:0] r3_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) r3_o<=0;else if(cls)r3_o<=r3_o;else r3_o<=r3_i;end else ;endmodule
|
138 |
|
|
module r4_reg_clr_cls(input[`R4_LEN-1:0] r4_i,output reg[`R4_LEN-1:0] r4_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) r4_o<=0;else if(cls)r4_o<=r4_o;else r4_o<=r4_i;end else ;endmodule
|
139 |
|
|
module r5_reg_clr_cls(input[`R5_LEN-1:0] r5_i,output reg[`R5_LEN-1:0] r5_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) r5_o<=0;else if(cls)r5_o<=r5_o;else r5_o<=r5_i;end else ;endmodule
|
140 |
|
|
module r32_reg_clr_cls(input[`R32_LEN-1:0] r32_i,output reg[`R32_LEN-1:0] r32_o,input clk,input clr,input cls,input hold);always@(posedge clk)if(hold==1)begin if(clr) r32_o<=0;else if(cls)r32_o<=r32_o;else r32_o<=r32_i;end else ;endmodule
|
141 |
|
|
|
142 |
|
|
|
143 |
|
|
module ext_ctl_reg_clr(input[`EXT_CTL_LEN-1:0] ext_ctl_i,output reg[`EXT_CTL_LEN-1:0] ext_ctl_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)ext_ctl_o<=0;else ext_ctl_o<=ext_ctl_i;end else ;endmodule
|
144 |
|
|
module rd_sel_reg_clr(input[`RD_SEL_LEN-1:0] rd_sel_i,output reg[`RD_SEL_LEN-1:0] rd_sel_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)rd_sel_o<=0;else rd_sel_o<=rd_sel_i;end else ;endmodule
|
145 |
|
|
module cmp_ctl_reg_clr(input[`CMP_CTL_LEN-1:0] cmp_ctl_i,output reg[`CMP_CTL_LEN-1:0] cmp_ctl_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)cmp_ctl_o<=0;else cmp_ctl_o<=cmp_ctl_i;end else ;endmodule
|
146 |
|
|
module pc_gen_ctl_reg_clr(input[`PC_GEN_CTL_LEN-1:0] pc_gen_ctl_i,output reg[`PC_GEN_CTL_LEN-1:0] pc_gen_ctl_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)pc_gen_ctl_o<=0;else pc_gen_ctl_o<=pc_gen_ctl_i;end else ;endmodule
|
147 |
|
|
module fsm_ctl_reg_clr(input[`FSM_CTL_LEN-1:0] fsm_ctl_i,output reg[`FSM_CTL_LEN-1:0] fsm_ctl_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)fsm_ctl_o<=0;else fsm_ctl_o<=fsm_ctl_i;end else ;endmodule
|
148 |
|
|
module muxa_ctl_reg_clr(input[`MUXA_CTL_LEN-1:0] muxa_ctl_i,output reg[`MUXA_CTL_LEN-1:0] muxa_ctl_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)muxa_ctl_o<=0;else muxa_ctl_o<=muxa_ctl_i;end else ;endmodule
|
149 |
|
|
module muxb_ctl_reg_clr(input[`MUXB_CTL_LEN-1:0] muxb_ctl_i,output reg[`MUXB_CTL_LEN-1:0] muxb_ctl_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)muxb_ctl_o<=0;else muxb_ctl_o<=muxb_ctl_i;end else ;endmodule
|
150 |
|
|
module alu_func_reg_clr(input[`ALU_FUNC_LEN-1:0] alu_func_i,output reg[`ALU_FUNC_LEN-1:0] alu_func_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)alu_func_o<=0;else alu_func_o<=alu_func_i;end else ;endmodule
|
151 |
|
|
module alu_we_reg_clr(input[`ALU_WE_LEN-1:0] alu_we_i,output reg[`ALU_WE_LEN-1:0] alu_we_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)alu_we_o<=0;else alu_we_o<=alu_we_i;end else ;endmodule
|
152 |
|
|
module dmem_ctl_reg_clr(input[`DMEM_CTL_LEN-1:0] dmem_ctl_i,output reg[`DMEM_CTL_LEN-1:0] dmem_ctl_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)dmem_ctl_o<=0;else dmem_ctl_o<=dmem_ctl_i;end else ;endmodule
|
153 |
|
|
module wb_mux_ctl_reg_clr(input[`WB_MUX_CTL_LEN-1:0] wb_mux_ctl_i,output reg[`WB_MUX_CTL_LEN-1:0] wb_mux_ctl_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)wb_mux_ctl_o<=0;else wb_mux_ctl_o<=wb_mux_ctl_i;end else ;endmodule
|
154 |
|
|
module wb_we_reg_clr(input[`WB_WE_LEN-1:0] wb_we_i,output reg[`WB_WE_LEN-1:0] wb_we_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)wb_we_o<=0;else wb_we_o<=wb_we_i;end else ;endmodule
|
155 |
|
|
module ins_reg_clr(input[`INS_LEN-1:0] ins_i,output reg[`INS_LEN-1:0] ins_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)ins_o<=0;else ins_o<=ins_i;end else ;endmodule
|
156 |
|
|
module pc_reg_clr(input[`PC_LEN-1:0] pc_i,output reg[`PC_LEN-1:0] pc_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)pc_o<=0;else pc_o<=pc_i;end else ;endmodule
|
157 |
|
|
module spc_reg_clr(input[`SPC_LEN-1:0] spc_i,output reg[`SPC_LEN-1:0] spc_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)spc_o<=0;else spc_o<=spc_i;end else ;endmodule
|
158 |
|
|
module r1_reg_clr(input[`R1_LEN-1:0] r1_i,output reg[`R1_LEN-1:0] r1_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)r1_o<=0;else r1_o<=r1_i;end else ;endmodule
|
159 |
|
|
module r2_reg_clr(input[`R2_LEN-1:0] r2_i,output reg[`R2_LEN-1:0] r2_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)r2_o<=0;else r2_o<=r2_i;end else ;endmodule
|
160 |
|
|
module r3_reg_clr(input[`R3_LEN-1:0] r3_i,output reg[`R3_LEN-1:0] r3_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)r3_o<=0;else r3_o<=r3_i;end else ;endmodule
|
161 |
|
|
module r4_reg_clr(input[`R4_LEN-1:0] r4_i,output reg[`R4_LEN-1:0] r4_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)r4_o<=0;else r4_o<=r4_i;end else ;endmodule
|
162 |
|
|
module r5_reg_clr(input[`R5_LEN-1:0] r5_i,output reg[`R5_LEN-1:0] r5_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)r5_o<=0;else r5_o<=r5_i;end else ;endmodule
|
163 |
|
|
module r32_reg_clr(input[`R32_LEN-1:0] r32_i,output reg[`R32_LEN-1:0] r32_o,input clk,input clr,input hold);always@(posedge clk)if(hold==1)begin if(clr)r32_o<=0;else r32_o<=r32_i;end else ;endmodule
|
164 |
|
|
|
165 |
|
|
|
166 |
|
|
module ext_ctl_reg(input[`EXT_CTL_LEN-1:0] ext_ctl_i,output reg[`EXT_CTL_LEN-1:0] ext_ctl_o,input clk,input hold);always@(posedge clk)if(hold==1) ext_ctl_o<=ext_ctl_i; else ;endmodule
|
167 |
|
|
module rd_sel_reg(input[`RD_SEL_LEN-1:0] rd_sel_i,output reg[`RD_SEL_LEN-1:0] rd_sel_o,input clk,input hold);always@(posedge clk)if(hold==1) rd_sel_o<=rd_sel_i;else ;endmodule
|
168 |
|
|
module cmp_ctl_reg(input[`CMP_CTL_LEN-1:0] cmp_ctl_i,output reg[`CMP_CTL_LEN-1:0] cmp_ctl_o,input clk,input hold);always@(posedge clk)if(hold==1) cmp_ctl_o<=cmp_ctl_i;else;endmodule
|
169 |
|
|
module pc_gen_ctl_reg(input[`PC_GEN_CTL_LEN-1:0] pc_gen_ctl_i,output reg[`PC_GEN_CTL_LEN-1:0] pc_gen_ctl_o,input clk,input hold);always@(posedge clk)if(hold==1) pc_gen_ctl_o<=pc_gen_ctl_i;else ;endmodule
|
170 |
|
|
module fsm_ctl_reg(input[`FSM_CTL_LEN-1:0] fsm_ctl_i,output reg[`FSM_CTL_LEN-1:0] fsm_ctl_o,input clk,input hold);always@(posedge clk)if(hold==1) fsm_ctl_o<=fsm_ctl_i; else ;endmodule
|
171 |
|
|
module muxa_ctl_reg(input[`MUXA_CTL_LEN-1:0] muxa_ctl_i,output reg[`MUXA_CTL_LEN-1:0] muxa_ctl_o,input clk,input hold);always@(posedge clk)if(hold==1) muxa_ctl_o<=muxa_ctl_i; else ;endmodule
|
172 |
|
|
module muxb_ctl_reg(input[`MUXB_CTL_LEN-1:0] muxb_ctl_i,output reg[`MUXB_CTL_LEN-1:0] muxb_ctl_o,input clk,input hold);always@(posedge clk)if(hold==1) muxb_ctl_o<=muxb_ctl_i; else ;endmodule
|
173 |
|
|
module alu_func_reg(input[`ALU_FUNC_LEN-1:0] alu_func_i,output reg[`ALU_FUNC_LEN-1:0] alu_func_o,input clk,input hold);always@(posedge clk)if(hold==1) alu_func_o<=alu_func_i; else ;endmodule
|
174 |
|
|
module alu_we_reg(input[`ALU_WE_LEN-1:0] alu_we_i,output reg[`ALU_WE_LEN-1:0] alu_we_o,input clk,input hold);always@(posedge clk)if(hold==1) alu_we_o<=alu_we_i; else ;endmodule
|
175 |
|
|
module dmem_ctl_reg(input[`DMEM_CTL_LEN-1:0] dmem_ctl_i,output reg[`DMEM_CTL_LEN-1:0] dmem_ctl_o,input clk,input hold);always@(posedge clk)if(hold==1) dmem_ctl_o<=dmem_ctl_i;else ;endmodule
|
176 |
|
|
module wb_mux_ctl_reg(input[`WB_MUX_CTL_LEN-1:0] wb_mux_ctl_i,output reg[`WB_MUX_CTL_LEN-1:0] wb_mux_ctl_o,input clk,input hold);always@(posedge clk)if(hold==1) wb_mux_ctl_o<=wb_mux_ctl_i;else ;endmodule
|
177 |
|
|
module wb_we_reg(input[`WB_WE_LEN-1:0] wb_we_i,output reg[`WB_WE_LEN-1:0] wb_we_o,input clk,input hold);always@(posedge clk)if(hold==1) wb_we_o<=wb_we_i;else ;endmodule
|
178 |
|
|
module ins_reg(input[`INS_LEN-1:0] ins_i,output reg[`INS_LEN-1:0] ins_o,input clk,input hold);always@(posedge clk)if(hold==1) ins_o<=ins_i; else ;endmodule
|
179 |
|
|
module pc_reg(input[`PC_LEN-1:0] pc_i,output reg[`PC_LEN-1:0] pc_o,input clk,input hold);always@(posedge clk)if(hold==1) pc_o<=pc_i; else ;endmodule
|
180 |
|
|
module spc_reg(input[`SPC_LEN-1:0] spc_i,output reg[`SPC_LEN-1:0] spc_o,input clk,input hold);always@(posedge clk,posedge hold)if(hold==1) spc_o<=spc_i; else ;endmodule
|
181 |
|
|
module r1_reg(input[`R1_LEN-1:0] r1_i,output reg[`R1_LEN-1:0] r1_o,input clk,input hold);always@(posedge clk)if(hold==1) r1_o<=r1_i; else ;endmodule
|
182 |
|
|
module r2_reg(input[`R2_LEN-1:0] r2_i,output reg[`R2_LEN-1:0] r2_o,input clk,input hold);always@(posedge clk)if(hold==1) r2_o<=r2_i; else ;endmodule
|
183 |
|
|
module r3_reg(input[`R3_LEN-1:0] r3_i,output reg[`R3_LEN-1:0] r3_o,input clk,input hold);always@(posedge clk)if(hold==1) r3_o<=r3_i; else ;endmodule
|
184 |
|
|
module r4_reg(input[`R4_LEN-1:0] r4_i,output reg[`R4_LEN-1:0] r4_o,input clk,input hold);always@(posedge clk)if(hold==1) r4_o<=r4_i; else ;endmodule
|
185 |
|
|
module r5_reg(input[`R5_LEN-1:0] r5_i,output reg[`R5_LEN-1:0] r5_o,input clk,input hold);always@(posedge clk)if(hold==1) r5_o<=r5_i; else ;endmodule
|
186 |
|
|
module r32_reg(input[`R32_LEN-1:0] r32_i,output reg[`R32_LEN-1:0] r32_o,input clk,input hold);always@(posedge clk)if(hold==1) r32_o<=r32_i; else ;endmodule
|
187 |
|
|
|
188 |
|
|
module r32_inst_reg(input[`R32_LEN-1:0] r32_i,output reg[`R32_LEN-1:0] r32_o,input clk,input hold,input imds,input branch);always@(posedge clk) if (hold == 1 || imds ==0) if (branch == 1) r32_o<=32'b0;else r32_o<=r32_i; else ;endmodule
|
189 |
|
|
/*module r32_inst_reg(input[`R32_LEN-1:0] r32_i,output reg[`R32_LEN-1:0] r32_o,input clk,input hold,input imds,input branch);always@(posedge clk) if (hold == 0) if (imds ==0) if (branch == 1)r32_o<=32'b0; else r32_o<=r32_i ;else ; else ; endmodule*/
|
190 |
|
|
module r32_data_reg(input[`R32_LEN-1:0] r32_i,output reg[`R32_LEN-1:0] r32_o,input clk,input hold,input dmds);always@(posedge clk) if (hold == 1 || dmds ==0) r32_o<=r32_i; else ;endmodule
|
191 |
|
|
module r4_asi_reg(input[4:0] r4_i,output reg[4:0] r4_o,input clk,input hold);always@(posedge clk)if(hold ==0) ; else r4_o<=r4_i;endmodule
|
192 |
|
|
module branch_reg_whold(input[`PC_LEN-1:0] pc_i,output reg[`PC_LEN-1:0] pc_o,input clk,input branch);always@(posedge clk) if (branch ==0) pc_o<=pc_i;else ; endmodule
|
193 |
|
|
//module pc_reg_whold(input[`PC_LEN-1:0] pc_i,output reg[`PC_LEN-1:0] pc_o,input clk);always@(posedge clk) pc_o<=pc_i; endmodule
|
194 |
|
|
//module r4_asi_reg_whold(input[3:0] r4_i,output reg[3:0] r4_o,input clk,input branch);always@(posedge clk)if(branch ==1) ; else r4_o<=r4_i;endmodule
|
195 |
|
|
module r32_pc_reg(input[`R32_LEN-1:0] r32_i,output reg[`R32_LEN-1:0] r32_o,input clk,input hold,input branch);always@(posedge clk) if (hold == 1) r32_o<=r32_i; else if (branch == 1) ; else ; endmodule
|
196 |
|
|
module r4_rdaddr_reg(input[4:0] r4_i,output reg[4:0] r4_o,input clk,input hold,input clr,input cls);always@(negedge clk)if(hold==1)begin if(clr) r4_o<=0;else if(cls)r4_o<=r4_o;else r4_o<=r4_i;end else ;endmodule
|
197 |
|
|
|
198 |
|
|
|
199 |
|
|
module ext_ctl_reg_cls(input[`EXT_CTL_LEN-1:0] ext_ctl_i,output reg[`EXT_CTL_LEN-1:0] ext_ctl_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) ext_ctl_o<=ext_ctl_o;else ext_ctl_o<=ext_ctl_i;end else ;endmodule
|
200 |
|
|
module rd_sel_reg_cls(input[`RD_SEL_LEN-1:0] rd_sel_i,output reg[`RD_SEL_LEN-1:0] rd_sel_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) rd_sel_o<=rd_sel_o;else rd_sel_o<=rd_sel_i;end else ;endmodule
|
201 |
|
|
module cmp_ctl_reg_cls(input[`CMP_CTL_LEN-1:0] cmp_ctl_i,output reg[`CMP_CTL_LEN-1:0] cmp_ctl_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) cmp_ctl_o<=cmp_ctl_o;else cmp_ctl_o<=cmp_ctl_i;end else ;endmodule
|
202 |
|
|
module pc_gen_ctl_reg_cls(input[`PC_GEN_CTL_LEN-1:0] pc_gen_ctl_i,output reg[`PC_GEN_CTL_LEN-1:0] pc_gen_ctl_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) pc_gen_ctl_o<=pc_gen_ctl_o;else pc_gen_ctl_o<=pc_gen_ctl_i;end else ;endmodule
|
203 |
|
|
module fsm_ctl_reg_cls(input[`FSM_CTL_LEN-1:0] fsm_ctl_i,output reg[`FSM_CTL_LEN-1:0] fsm_ctl_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) fsm_ctl_o<=fsm_ctl_o;else fsm_ctl_o<=fsm_ctl_i;end else ;endmodule
|
204 |
|
|
module muxa_ctl_reg_cls(input[`MUXA_CTL_LEN-1:0] muxa_ctl_i,output reg[`MUXA_CTL_LEN-1:0] muxa_ctl_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) muxa_ctl_o<=muxa_ctl_o;else muxa_ctl_o<=muxa_ctl_i;end else ;endmodule
|
205 |
|
|
module muxb_ctl_reg_cls(input[`MUXB_CTL_LEN-1:0] muxb_ctl_i,output reg[`MUXB_CTL_LEN-1:0] muxb_ctl_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) muxb_ctl_o<=muxb_ctl_o;else muxb_ctl_o<=muxb_ctl_i;end else ;endmodule
|
206 |
|
|
module alu_func_reg_cls(input[`ALU_FUNC_LEN-1:0] alu_func_i,output reg[`ALU_FUNC_LEN-1:0] alu_func_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) alu_func_o<=alu_func_o;else alu_func_o<=alu_func_i;end else ;endmodule
|
207 |
|
|
module alu_we_reg_cls(input[`ALU_WE_LEN-1:0] alu_we_i,output reg[`ALU_WE_LEN-1:0] alu_we_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) alu_we_o<=alu_we_o;else alu_we_o<=alu_we_i;end else ;endmodule
|
208 |
|
|
module dmem_ctl_reg_cls(input[`DMEM_CTL_LEN-1:0] dmem_ctl_i,output reg[`DMEM_CTL_LEN-1:0] dmem_ctl_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) dmem_ctl_o<=dmem_ctl_o;else dmem_ctl_o<=dmem_ctl_i;end else ;endmodule
|
209 |
|
|
module wb_mux_ctl_reg_cls(input[`WB_MUX_CTL_LEN-1:0] wb_mux_ctl_i,output reg[`WB_MUX_CTL_LEN-1:0] wb_mux_ctl_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) wb_mux_ctl_o<=wb_mux_ctl_o;else wb_mux_ctl_o<=wb_mux_ctl_i;end else ;endmodule
|
210 |
|
|
module wb_we_reg_cls(input[`WB_WE_LEN-1:0] wb_we_i,output reg[`WB_WE_LEN-1:0] wb_we_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) wb_we_o<=wb_we_o;else wb_we_o<=wb_we_i;end else ;endmodule
|
211 |
|
|
module ins_reg_cls(input[`INS_LEN-1:0] ins_i,output reg[`INS_LEN-1:0] ins_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) ins_o<=ins_o;else ins_o<=ins_i;end else ;endmodule
|
212 |
|
|
module pc_reg_cls(input[`PC_LEN-1:0] pc_i,output reg[`PC_LEN-1:0] pc_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) pc_o<=pc_o;else pc_o<=pc_i;end else ;endmodule
|
213 |
|
|
module spc_reg_cls(input[`SPC_LEN-1:0] spc_i,output reg[`SPC_LEN-1:0] spc_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) spc_o<=spc_o;else spc_o<=spc_i;end else ;endmodule
|
214 |
|
|
module r1_reg_cls(input[`R1_LEN-1:0] r1_i,output reg[`R1_LEN-1:0] r1_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) r1_o<=r1_o;else r1_o<=r1_i;end else ;endmodule
|
215 |
|
|
module r2_reg_cls(input[`R2_LEN-1:0] r2_i,output reg[`R2_LEN-1:0] r2_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) r2_o<=r2_o;else r2_o<=r2_i;end else ;endmodule
|
216 |
|
|
module r3_reg_cls(input[`R3_LEN-1:0] r3_i,output reg[`R3_LEN-1:0] r3_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) r3_o<=r3_o;else r3_o<=r3_i;end else ;endmodule
|
217 |
|
|
module r4_reg_cls(input[`R4_LEN-1:0] r4_i,output reg[`R4_LEN-1:0] r4_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) r4_o<=r4_o;else r4_o<=r4_i;end else ;endmodule
|
218 |
|
|
module r5_reg_cls(input[`R5_LEN-1:0] r5_i,output reg[`R5_LEN-1:0] r5_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) r5_o<=r5_o;else r5_o<=r5_i;end else ;endmodule
|
219 |
|
|
module r32_reg_cls(input[`R32_LEN-1:0] r32_i,output reg[`R32_LEN-1:0] r32_o,input clk,input cls,input hold);always@(posedge clk)if(hold==1)begin if(cls) r32_o<=r32_o;else r32_o<=r32_i;end else ;endmodule
|
220 |
|
|
|
221 |
|
|
|