-
各个阶段的pc是要放一个模块里,还是各个模块用dff分别存?
chiplab里是这样一排的流水线寄存器一起传给下一个stage。 input is_port0_valid, input [`GRLEN-1:0] is_port0_pc, input [31:0] is_port0_inst, input [`LSOC1K_DECODE_RES_BIT-1:0] is_port0_op, input [`GRLEN-3:0] is_port0_br_target, input is_port0_br_taken, input is_port0_exception, input [5 :0] is_port0_exccode, input is_port0_rf_wen, input [4:0] is_port0_rf_target, input [`LSOC1K_PRU_HINT:0] is_port0_hint, OpenSPARC T1里的做法是不同的模块管理相关的信号和各个stage的流水线寄存器。 比如sparc_ifu_fdp是ifu的data path,里面存着pc的各阶段的寄存器,需要的时候也是从这里像各个模块发出。 // D stage PC and nPC dff_s #(49) pcd_reg(.din (pc_s), .q (pc_d), .clk (clk), .se(se),...
-
irf的read port是该在上升沿读出数据吗,需要ren吗?
// register file for MIPS 32 module reg_file( input clk, // input rst, input [ 4:0] waddr1, input [ 4:0] raddr0_0, input [ 4:0] raddr0_1, input wen1, input [`GRLEN-1:0] wdata1, output [`GRLEN-1:0] rdata0_0, output [`GRLEN-1:0] rdata0_1, input [ 4:0] waddr2, input [ 4:0] raddr1_0, input [ 4:0] raddr1_1, input wen2,...
-
单发射就不需要issue stage了吧
过段时间就全忘啊。。 verilator模拟的时候出一大堆Read Miss Addr0,这个是正常的,不知道刚开始怎么着就读到地址0了。 新加模块什么的,重新编译要先make clean,现在没时间改进makefile。 要是make clean_all,一定记得在run_func,也就是make的目录下makdir log,创建log文件夹,要不后面不编译了。 verilator要用的内存文件最后在./tmp/ram.dat Makefile里有这句,不过tmp目录运行完就删除了。 cat ./tmp/rom.vlog > ./tmp/ram.dat; 确认有ram.dat,verilator就能读内存了。刚开始被一堆的Read Miss Addr0给整不会了,以为是内存文件没生成出来。 而且后来读内存的时候,是从1c000000开始读的,但读出来的是0,开始也是以为内存文件的事。 cpu7模块里本来想完全从头写,先只放cpu7_ifu和cpu7_exu,可发现没有tlb和csr模块控制cache,读内存会出问题。 本打算借着这个机会把cache看看,结果先试了把csr和tlb_wrapper加了回来,结果指令取值正常了。 那就先这样吧,一个inst_req要6个还是7个周期才读成功,inst_addr_ok和inst_valid同时返回,还没有看是因为什么。 先在cpu7_ifu里有cpu7_ifu_fdp和cpu7_ifu_dec,取值,解码。 obj/main.elf: file format elf32-loongarch obj/main.elf Disassembly of section .text: 1c000000 <_start>: kernel_entry(): 1c000000: 0280058c addi.w $r12,$r12,1(0x1) 1c000004: 0280098c addi.w $r12,$r12,2(0x2) 1c000008: 02800d8c addi.w $r12,$r12,3(0x3) 1c00000c: 0280118c addi.w...