u@home:~$

  • mul指令

    LoongArch32上只有mul.w mulh.w mulh.wu这三条。 mul64x64模块试了下,下一个周期就能返回结果。 比如mul.w,试了下2 x 2和-1 x -1。 又试了下mulhwu,结果对,也是下个周期就返回。 其实就可以把这个结果按_m返回直接丢给rd_data_mux了。 网上搜了下,说mul指令是可以一个周期完成的,就是快就需要很多full adder,在以前的话比较费资源。 不过我还没时间好好学习这部分,直接用了chiplab里的mul64x64模块,连接口也没改。 1 module mul64x64( 2 input clk, 3 input rstn, 4 5 input mul_validin, 6 input ex2_allowin, 7 output mul_validout, 8 input ex1_readygo, 9 input ex2_readygo, 10 11 input [63:0] opa, 12 input [63:0] opb, 13 input...

  • exu_ifu_stall_req

    exu_ifu_stall_req This signal stalls the IFU from fetching next instruction and the pc_f remains. When executing a load instruction, the pipeline need to be stalled until it retrives data. assign fdp_dec_valid = inst_valid & ~exu_ifu_stall_req & ~br_taken; exu_ifu_stall_req should contains br_taken. Turns out, br_taken better not mess with exu_ifu_stall_req because...

  • chiplab里cache向tlb模块查询物理地址的信号

    cache模块向tlbwrapper模块发请求,给出vaddr,要求得到paddr。 因为现在只有machine mode,没有虚实地址转换,所以直接把vaddr返回来作为paddr就行。 icache发的请求就是这3个信号。 23 input inst_tlb_req , 24 input [`GRLEN-1:0] inst_tlb_vaddr, 25 input inst_tlb_cacop, inst_tlb_cacop还没搞清楚是啥,也没管。 需要返回的信号是这几个output。 42 // tlb-cache interface 43 output [`PABITS-1:0] itlb_paddr, 44 output itlb_finish, 45 output itlb_hit, 46 input itlb_cache_recv, 47 output itlb_uncache, 48 output [ 5:0] itlb_exccode, chiplab里的tlb似乎是需要2个cycle完成应答。 第一个cycle发出inst_tlb_req inst_tlb_vaddr,后一个cycle里给出itlb_paddr itlb_finish itlb_hit itlb_uncache。 dcache也是差不多的接口。 51...