【CPU设计实战】简单流水线CPU设计

这篇具有很好参考价值的文章主要介绍了【CPU设计实战】简单流水线CPU设计。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

数据通路

CPU输入的、运算的、存储的、输出的数据都在组合逻辑和时序逻辑电路上流转,这些逻辑电路称为数据通路

PC

32位处理器用32位触发器来存放PC。PC的输出送到虚实地址转换部件进行转换,PC的输入有两个,一个是复位值0xBFC00000,一个是复位撤销后每执行一条指令更新为当前PC+4得到的值。

虚实地址转换

在实现TLB MMU之前,CPU都采用固定映射的地址映射机制,以段为单位进行虚实地址转换,转换的方式是硬件固定的,而不是软件可配置的。

映射算法

虚地址kseg0段(0x8000000 ~ 0x9FFFFFFF)映射到物理地址最低512MB(0x00000000~0x1FFFFFFF)。
虚地址kseg1段(0xA0000000 ~ 0xBFFFFFFF)映射到物理地址最低512MB(0x00000000~0x1FFFFFFF)。
其余三个段都是物理地址的值等于虚地址的值。

指令RAM

采用片上RAM作为内存,将RAM进一步拆为指令RAM和数据RAM,两块物理上独立的RAM。
目前工程实践常用的都是同步读RAM。第一拍发读请求和读地址,第二拍RAM才会输出读数据。这种RAM无法实现单周期CPU,所以暂时使用异步RAM。异步RAM读时序行为类似寄存器堆的读,当拍给地址、当拍出数据,其时序行为和同步读RAM的一样。

ADDU和ADDIU

加法器可复用。

差异一

ADDU:第二个操作数是通用寄存器堆读端口2的输出数据rdata2。
ADDIU:第二个源操作数是指令码的15-0位有符号扩展至32位后形成的数据。
加法器的第二个输入数据来源要分情况处理,电路设计上是通过引入一个32位的二选一部件来体现的
二选一的in1—rdata2
in2—指令码的15-0位有符号扩展到32位后形成的数据
out—加法器第二个数据输入
sel—控制信号(ADDUI和ADDU在编码上是可区分的,利用这一点作为产生多路选择器的控制信号)

差异二

ADDU的结果写入rd中,ADDUI写到rt中。通用寄存器的写端口地址不再唯一,再引入一个二选一,从指令码rd域数值和rt域数值中选择一个结果,再连接到通用寄存器堆写端口的写地址端口waddr上。

SUBU

与ADDU的区别在于前者做的是减法,后者做的是加法。考虑到补码加减运算的属性
A补-B补=(A-B)补=A补+(-B)补=A补+(~ B补)+1
对加法器对的源操作数2的进位和输入添加二选一部件。
源操作数2—src2,处理减法时按位取反
进位输入在处理加法时是0,在处理减法时是1
选择信号是通过不同指令间指令码的差异实现控制信号的区分

LW和SW

在取指方面的功能与ADDU一样。

  • 访存地址生成
  • 数据RAM
  • 寄存器堆写回结果选择
  • SW指令和LW指令的区别在于LW读RAM写通用寄存器而SW读通用寄存器写RAM。对于sw要在lw的基础上对写RAM功能增加新的数据通路。写入内存的是第rt号寄存器的值。
    将通用寄存器堆读端口2的输出rdata2连接到数据RAM的写数据端口wdata上
    $rt–>rdata2–>wdata
    ==========================================================
    好多二选一,我也没有跟着画,我脑子已经糊了,一点也不想
    学。。。。。。。。。。。
    ==========================================================

BEQ和BNE

(1)判断分支条件
(2)计算跳转目标
(3)PC更新

JAL和JR

JAL

(1)不用进行分支条件判断,一定会跳转
(2)计算跳转目标地址是转移延迟槽指令的PC和指令码中的立即数,就算方式是拼接不是相加
(3)不仅要修改PC,还要写通用寄存器
注意一下link操作,call,return两个跳转

JR

(1)不需要进行条件判断,一定会跳转
(2)跳转的目标地址来自通用寄存器堆的rs

STL和STLU

算术运算类指令
从源操作数输入到结果的运算过程和ADD,ADDU不一样,其他是一样的。所以增加一个能处理两个32位数据有符号和无符号大小比较的比较器。

输入

与连接到加法器的数据输入相同
控制信号的输入用于标识有符号比较还是无符号比较

输出

输出比较结果为0或1
增加一个32位二选一部件,in0接入原有加法器的输出,in1接入比较器的结果。
如果用"<“或者”>"去比较,会消耗一定的逻辑电路资源
通过复用加法器GR[rs]-GR[rt]的运算,根据源操作数的正负,和(sum)的正负,进位(cout)的正负就可以得到SLT和SLTU的结果。这些结果和原有的加法器结果通过一个二选一部件得到运算类指令的执行结果,然后输入到产生最终写通用寄存器值的那个二选一部件上。

SLL,SRL,SRA

移位指令。分别是逻辑左移,逻辑右移,算术右移。
添加一个“移位器”数据通路。

输入/输出

输入:

  • 32位的被移位数值src
  • 5位的移位量sa
  • 控制输入用于确定移位操作的类型op

输出:

  • 32位移位结果res
    src<-rdata2
    sa<-sa
    执行结果的最终选择电路要从“二选一”扩展为“三选一”。根据shft_op选择shft_res

一种面积优化电路设计

基本思想是将被移位的数据逆序排列后,左移操作被转换为右移操作

=============================================================

任务和实践

实践一:简单CPU参考设计调试

简要步骤:

  • 打开cpu132_gettrace(cpu132_gettrace.xpr)工程,进行IP核升级
  • 运行cpu132_gettrace(cpu132_gettrace.xpr)工程的仿真,生成新的参考Trace文件golden_trace.txt等仿真运行完成后,golden_trace.txt才会有新的内容
  • 打开myCPU工程,进行IP核的升级
  • 运行myCPU的仿真,进行运行以及调试
  • myCPU仿真通过后,综合实现还有生成比特流文件,进行上板验证

仿真结果的判断

下面是控制台的输出:
如果全都是PASS就是运行通过了,这是发布包给的样例CPU,肯定是都没有任何问题的,所以理所当然89个测试点都通过了。

==============================================================
Test begin!
----[  14055 ns] Number 8'd01 Functional Test Point PASS!!!
        [  22000 ns] Test is running, debug_wb_pc = 0xbfc5e4bc
        [  32000 ns] Test is running, debug_wb_pc = 0xbfc5f45c
----[  40555 ns] Number 8'd02 Functional Test Point PASS!!!
        [  42000 ns] Test is running, debug_wb_pc = 0xbfc89418
----[  49475 ns] Number 8'd03 Functional Test Point PASS!!!
        [  52000 ns] Test is running, debug_wb_pc = 0xbfc3ac78
        [  62000 ns] Test is running, debug_wb_pc = 0xbfc3bf94
        [  72000 ns] Test is running, debug_wb_pc = 0xbfc3d278
----[  73845 ns] Number 8'd04 Functional Test Point PASS!!!
        [  82000 ns] Test is running, debug_wb_pc = 0xbfc24530
        [  92000 ns] Test is running, debug_wb_pc = 0xbfc2568c
        [ 102000 ns] Test is running, debug_wb_pc = 0xbfc26c18
----[ 111715 ns] Number 8'd05 Functional Test Point PASS!!!
        [ 112000 ns] Test is running, debug_wb_pc = 0xbfc00768
        [ 122000 ns] Test is running, debug_wb_pc = 0xbfc4a308
----[ 127355 ns] Number 8'd06 Functional Test Point PASS!!!
        [ 132000 ns] Test is running, debug_wb_pc = 0xbfc6a758
        [ 142000 ns] Test is running, debug_wb_pc = 0xbfc6b6f8
        [ 152000 ns] Test is running, debug_wb_pc = 0xbfc6c698
----[ 153775 ns] Number 8'd07 Functional Test Point PASS!!!
        [ 162000 ns] Test is running, debug_wb_pc = 0xbfc50aa0
        [ 172000 ns] Test is running, debug_wb_pc = 0xbfc51a40
----[ 177225 ns] Number 8'd08 Functional Test Point PASS!!!
        [ 182000 ns] Test is running, debug_wb_pc = 0xbfc03c5c
        [ 192000 ns] Test is running, debug_wb_pc = 0xbfc04bfc
----[ 195165 ns] Number 8'd09 Functional Test Point PASS!!!
        [ 202000 ns] Test is running, debug_wb_pc = 0xbfc3e0a4
        [ 212000 ns] Test is running, debug_wb_pc = 0xbfc3f044
----[ 213105 ns] Number 8'd10 Functional Test Point PASS!!!
        [ 222000 ns] Test is running, debug_wb_pc = 0xbfc6f88c
        [ 232000 ns] Test is running, debug_wb_pc = 0xbfc7082c
----[ 232405 ns] Number 8'd11 Functional Test Point PASS!!!
        [ 242000 ns] Test is running, debug_wb_pc = 0xbfc02484
----[ 249835 ns] Number 8'd12 Functional Test Point PASS!!!
        [ 252000 ns] Test is running, debug_wb_pc = 0xbfc3f558
        [ 262000 ns] Test is running, debug_wb_pc = 0xbfc406ec
        [ 272000 ns] Test is running, debug_wb_pc = 0xbfc418ac
----[ 278055 ns] Number 8'd13 Functional Test Point PASS!!!
        [ 282000 ns] Test is running, debug_wb_pc = 0xbfc63e60
        [ 292000 ns] Test is running, debug_wb_pc = 0xbfc64f80
        [ 302000 ns] Test is running, debug_wb_pc = 0xbfc660bc
        [ 312000 ns] Test is running, debug_wb_pc = 0xbfc671ac
----[ 316265 ns] Number 8'd14 Functional Test Point PASS!!!
        [ 322000 ns] Test is running, debug_wb_pc = 0xbfc8439c
        [ 332000 ns] Test is running, debug_wb_pc = 0xbfc854f8
        [ 342000 ns] Test is running, debug_wb_pc = 0xbfc86654
        [ 352000 ns] Test is running, debug_wb_pc = 0xbfc877b0
----[ 354995 ns] Number 8'd15 Functional Test Point PASS!!!
----[ 358265 ns] Number 8'd16 Functional Test Point PASS!!!
----[ 361535 ns] Number 8'd17 Functional Test Point PASS!!!
        [ 362000 ns] Test is running, debug_wb_pc = 0xbfc39ab8
----[ 363495 ns] Number 8'd18 Functional Test Point PASS!!!
----[ 365975 ns] Number 8'd19 Functional Test Point PASS!!!
----[ 368455 ns] Number 8'd20 Functional Test Point PASS!!!
        [ 372000 ns] Test is running, debug_wb_pc = 0xbfc7f790
        [ 382000 ns] Test is running, debug_wb_pc = 0xbfc80730
----[ 390305 ns] Number 8'd21 Functional Test Point PASS!!!
        [ 392000 ns] Test is running, debug_wb_pc = 0xbfc0a8dc
        [ 402000 ns] Test is running, debug_wb_pc = 0xbfc0b87c
----[ 410745 ns] Number 8'd22 Functional Test Point PASS!!!
        [ 412000 ns] Test is running, debug_wb_pc = 0xbfc329ac
        [ 422000 ns] Test is running, debug_wb_pc = 0xbfc3394c
        [ 432000 ns] Test is running, debug_wb_pc = 0xbfc348ec
----[ 432145 ns] Number 8'd23 Functional Test Point PASS!!!
        [ 442000 ns] Test is running, debug_wb_pc = 0xbfc61e2c
        [ 452000 ns] Test is running, debug_wb_pc = 0xbfc62dcc
----[ 458595 ns] Number 8'd24 Functional Test Point PASS!!!
        [ 462000 ns] Test is running, debug_wb_pc = 0xbfc7ac48
        [ 472000 ns] Test is running, debug_wb_pc = 0xbfc7bbe8
        [ 482000 ns] Test is running, debug_wb_pc = 0xbfc7cb88
----[ 482045 ns] Number 8'd25 Functional Test Point PASS!!!
        [ 492000 ns] Test is running, debug_wb_pc = 0xbfc4dae4
        [ 502000 ns] Test is running, debug_wb_pc = 0xbfc4ea84
----[ 507425 ns] Number 8'd26 Functional Test Point PASS!!!
        [ 512000 ns] Test is running, debug_wb_pc = 0xbfc6d62c
        [ 522000 ns] Test is running, debug_wb_pc = 0xbfc6e5cc
----[ 525365 ns] Number 8'd27 Functional Test Point PASS!!!
        [ 532000 ns] Test is running, debug_wb_pc = 0xbfc8a9b4
        [ 542000 ns] Test is running, debug_wb_pc = 0xbfc8b954
----[ 551795 ns] Number 8'd28 Functional Test Point PASS!!!
        [ 552000 ns] Test is running, debug_wb_pc = 0xbfc00d80
        [ 562000 ns] Test is running, debug_wb_pc = 0xbfc78f58
        [ 572000 ns] Test is running, debug_wb_pc = 0xbfc79ef8
----[ 572235 ns] Number 8'd29 Functional Test Point PASS!!!
        [ 582000 ns] Test is running, debug_wb_pc = 0xbfc47bd8
        [ 592000 ns] Test is running, debug_wb_pc = 0xbfc48b78
----[ 598685 ns] Number 8'd30 Functional Test Point PASS!!!
        [ 602000 ns] Test is running, debug_wb_pc = 0xbfc088e4
        [ 612000 ns] Test is running, debug_wb_pc = 0xbfc09884
----[ 619125 ns] Number 8'd31 Functional Test Point PASS!!!
        [ 622000 ns] Test is running, debug_wb_pc = 0xbfc761b4
        [ 632000 ns] Test is running, debug_wb_pc = 0xbfc77154
----[ 641295 ns] Number 8'd32 Functional Test Point PASS!!!
        [ 642000 ns] Test is running, debug_wb_pc = 0xbfc42400
        [ 652000 ns] Test is running, debug_wb_pc = 0xbfc433a0
----[ 660535 ns] Number 8'd33 Functional Test Point PASS!!!
        [ 662000 ns] Test is running, debug_wb_pc = 0xbfc0cb00
        [ 672000 ns] Test is running, debug_wb_pc = 0xbfc0daa0
        [ 682000 ns] Test is running, debug_wb_pc = 0xbfc0ea40
----[ 682945 ns] Number 8'd34 Functional Test Point PASS!!!
        [ 692000 ns] Test is running, debug_wb_pc = 0xbfc0710c
        [ 702000 ns] Test is running, debug_wb_pc = 0xbfc080ac
----[ 702315 ns] Number 8'd35 Functional Test Point PASS!!!
        [ 712000 ns] Test is running, debug_wb_pc = 0xbfc5c1e8
        [ 722000 ns] Test is running, debug_wb_pc = 0xbfc5d188
----[ 724735 ns] Number 8'd36 Functional Test Point PASS!!!
        [ 732000 ns] Test is running, debug_wb_pc = 0xbfc56c68
        [ 742000 ns] Test is running, debug_wb_pc = 0xbfc57fb8
        [ 752000 ns] Test is running, debug_wb_pc = 0xbfc59398
        [ 762000 ns] Test is running, debug_wb_pc = 0xbfc5a760
----[ 767945 ns] Number 8'd37 Functional Test Point PASS!!!
        [ 772000 ns] Test is running, debug_wb_pc = 0xbfc1e714
        [ 782000 ns] Test is running, debug_wb_pc = 0xbfc1faec
        [ 792000 ns] Test is running, debug_wb_pc = 0xbfc20ea4
        [ 802000 ns] Test is running, debug_wb_pc = 0xbfc222a8
----[ 810875 ns] Number 8'd38 Functional Test Point PASS!!!
        [ 812000 ns] Test is running, debug_wb_pc = 0xbfc70a80
        [ 822000 ns] Test is running, debug_wb_pc = 0xbfc71e88
        [ 832000 ns] Test is running, debug_wb_pc = 0xbfc73224
        [ 842000 ns] Test is running, debug_wb_pc = 0xbfc745bc
        [ 852000 ns] Test is running, debug_wb_pc = 0xbfc759e0
----[ 854085 ns] Number 8'd39 Functional Test Point PASS!!!
        [ 862000 ns] Test is running, debug_wb_pc = 0xbfc52f9c
        [ 872000 ns] Test is running, debug_wb_pc = 0xbfc541dc
        [ 882000 ns] Test is running, debug_wb_pc = 0xbfc5543c
----[ 887675 ns] Number 8'd40 Functional Test Point PASS!!!
        [ 892000 ns] Test is running, debug_wb_pc = 0xbfc29238
        [ 902000 ns] Test is running, debug_wb_pc = 0xbfc2a478
        [ 912000 ns] Test is running, debug_wb_pc = 0xbfc2b690
        [ 922000 ns] Test is running, debug_wb_pc = 0xbfc2c8e8
        [ 932000 ns] Test is running, debug_wb_pc = 0xbfc2db98
----[ 935465 ns] Number 8'd41 Functional Test Point PASS!!!
        [ 942000 ns] Test is running, debug_wb_pc = 0xbfc1901c
        [ 952000 ns] Test is running, debug_wb_pc = 0xbfc1a2cc
        [ 962000 ns] Test is running, debug_wb_pc = 0xbfc1b51c
        [ 972000 ns] Test is running, debug_wb_pc = 0xbfc1c75c
        [ 982000 ns] Test is running, debug_wb_pc = 0xbfc1d98c
----[ 985425 ns] Number 8'd42 Functional Test Point PASS!!!
        [ 992000 ns] Test is running, debug_wb_pc = 0xbfc11cac
        [1002000 ns] Test is running, debug_wb_pc = 0xbfc12cb4
        [1012000 ns] Test is running, debug_wb_pc = 0xbfc13ccc
        [1022000 ns] Test is running, debug_wb_pc = 0xbfc14cc0
        [1032000 ns] Test is running, debug_wb_pc = 0xbfc15cc8
----[1040415 ns] Number 8'd43 Functional Test Point PASS!!!
        [1042000 ns] Test is running, debug_wb_pc = 0xbfc7d848
        [1052000 ns] Test is running, debug_wb_pc = 0xbfc7dd00
        [1062000 ns] Test is running, debug_wb_pc = 0xbfc7e1b0
        [1072000 ns] Test is running, debug_wb_pc = 0xbfc7e648
        [1082000 ns] Test is running, debug_wb_pc = 0xbfc7eae0
        [1092000 ns] Test is running, debug_wb_pc = 0xbfc7efac
----[1098085 ns] Number 8'd44 Functional Test Point PASS!!!
        [1102000 ns] Test is running, debug_wb_pc = 0xbfc0ed60
        [1112000 ns] Test is running, debug_wb_pc = 0xbfc0f210
        [1122000 ns] Test is running, debug_wb_pc = 0xbfc0f6c8
        [1132000 ns] Test is running, debug_wb_pc = 0xbfc0fb60
        [1142000 ns] Test is running, debug_wb_pc = 0xbfc0fff8
        [1152000 ns] Test is running, debug_wb_pc = 0xbfc104bc
        [1162000 ns] Test is running, debug_wb_pc = 0xbfc10960
        [1172000 ns] Test is running, debug_wb_pc = 0xbfc10df8
----[1181995 ns] Number 8'd45 Functional Test Point PASS!!!
        [1182000 ns] Test is running, debug_wb_pc = 0xbfc1129c
        [1192000 ns] Test is running, debug_wb_pc = 0xbfc34df4
        [1202000 ns] Test is running, debug_wb_pc = 0xbfc352f8
        [1212000 ns] Test is running, debug_wb_pc = 0xbfc35808
        [1222000 ns] Test is running, debug_wb_pc = 0xbfc35cf4
        [1232000 ns] Test is running, debug_wb_pc = 0xbfc361dc
        [1242000 ns] Test is running, debug_wb_pc = 0xbfc366f8
        [1252000 ns] Test is running, debug_wb_pc = 0xbfc36b98
----[1256455 ns] Number 8'd46 Functional Test Point PASS!!!
        [1262000 ns] Test is running, debug_wb_pc = 0xbfc81bec
        [1272000 ns] Test is running, debug_wb_pc = 0xbfc820d8
        [1282000 ns] Test is running, debug_wb_pc = 0xbfc825c4
        [1292000 ns] Test is running, debug_wb_pc = 0xbfc82ad0
        [1302000 ns] Test is running, debug_wb_pc = 0xbfc82fd8
        [1312000 ns] Test is running, debug_wb_pc = 0xbfc834c0
        [1322000 ns] Test is running, debug_wb_pc = 0xbfc83984
----[1323235 ns] Number 8'd47 Functional Test Point PASS!!!
        [1332000 ns] Test is running, debug_wb_pc = 0xbfc89108
----[1332805 ns] Number 8'd48 Functional Test Point PASS!!!
        [1342000 ns] Test is running, debug_wb_pc = 0xbfc183e4
----[1342355 ns] Number 8'd49 Functional Test Point PASS!!!
----[1351285 ns] Number 8'd50 Functional Test Point PASS!!!
        [1352000 ns] Test is running, debug_wb_pc = 0xbfc280f4
----[1356455 ns] Number 8'd51 Functional Test Point PASS!!!
        [1362000 ns] Test is running, debug_wb_pc = 0xbfc03448
----[1364545 ns] Number 8'd52 Functional Test Point PASS!!!
        [1372000 ns] Test is running, debug_wb_pc = 0xbfc01474
----[1373275 ns] Number 8'd53 Functional Test Point PASS!!!
----[1381685 ns] Number 8'd54 Functional Test Point PASS!!!
        [1382000 ns] Test is running, debug_wb_pc = 0xbfc7d024
----[1390415 ns] Number 8'd55 Functional Test Point PASS!!!
        [1392000 ns] Test is running, debug_wb_pc = 0xbfc16c68
----[1399785 ns] Number 8'd56 Functional Test Point PASS!!!
        [1402000 ns] Test is running, debug_wb_pc = 0xbfc3a32c
----[1408515 ns] Number 8'd57 Functional Test Point PASS!!!
        [1412000 ns] Test is running, debug_wb_pc = 0xbfc4f9ec
----[1414895 ns] Number 8'd58 Functional Test Point PASS!!!
        [1422000 ns] Test is running, debug_wb_pc = 0xbfc37a30
        [1432000 ns] Test is running, debug_wb_pc = 0xbfc3873c
        [1442000 ns] Test is running, debug_wb_pc = 0xbfc39438
----[1442695 ns] Number 8'd59 Functional Test Point PASS!!!
        [1452000 ns] Test is running, debug_wb_pc = 0xbfc684b0
        [1462000 ns] Test is running, debug_wb_pc = 0xbfc691d0
        [1472000 ns] Test is running, debug_wb_pc = 0xbfc69eb0
----[1472445 ns] Number 8'd60 Functional Test Point PASS!!!
        [1482000 ns] Test is running, debug_wb_pc = 0xbfc2ee34
        [1492000 ns] Test is running, debug_wb_pc = 0xbfc2fb84
----[1494295 ns] Number 8'd61 Functional Test Point PASS!!!
        [1502000 ns] Test is running, debug_wb_pc = 0xbfc4b370
        [1512000 ns] Test is running, debug_wb_pc = 0xbfc4c094
----[1519125 ns] Number 8'd62 Functional Test Point PASS!!!
        [1522000 ns] Test is running, debug_wb_pc = 0xbfc44460
        [1532000 ns] Test is running, debug_wb_pc = 0xbfc451b8
        [1542000 ns] Test is running, debug_wb_pc = 0xbfc45f64
----[1550155 ns] Number 8'd63 Functional Test Point PASS!!!
        [1552000 ns] Test is running, debug_wb_pc = 0xbfc30068
        [1562000 ns] Test is running, debug_wb_pc = 0xbfc30dc8
        [1572000 ns] Test is running, debug_wb_pc = 0xbfc31b78
----[1579395 ns] Number 8'd64 Functional Test Point PASS!!!
        [1582000 ns] Test is running, debug_wb_pc = 0xbfc003f0
----[1585025 ns] Number 8'd65 Functional Test Point PASS!!!
----[1590865 ns] Number 8'd66 Functional Test Point PASS!!!
        [1592000 ns] Test is running, debug_wb_pc = 0xbfc7cc14
----[1597545 ns] Number 8'd67 Functional Test Point PASS!!!
        [1602000 ns] Test is running, debug_wb_pc = 0xbfc003b0
----[1604135 ns] Number 8'd68 Functional Test Point PASS!!!
----[1610815 ns] Number 8'd69 Functional Test Point PASS!!!
        [1612000 ns] Test is running, debug_wb_pc = 0xbfc015b8
----[1618185 ns] Number 8'd70 Functional Test Point PASS!!!
        [1622000 ns] Test is running, debug_wb_pc = 0xbfc00690
----[1625575 ns] Number 8'd71 Functional Test Point PASS!!!
        [1632000 ns] Test is running, debug_wb_pc = 0xbfc0c890
----[1632945 ns] Number 8'd72 Functional Test Point PASS!!!
----[1640605 ns] Number 8'd73 Functional Test Point PASS!!!
        [1642000 ns] Test is running, debug_wb_pc = 0xbfc5d698
----[1648265 ns] Number 8'd74 Functional Test Point PASS!!!
        [1652000 ns] Test is running, debug_wb_pc = 0xbfc00564
----[1655825 ns] Number 8'd75 Functional Test Point PASS!!!
        [1662000 ns] Test is running, debug_wb_pc = 0xbfc39fc4
----[1662755 ns] Number 8'd76 Functional Test Point PASS!!!
----[1671965 ns] Number 8'd77 Functional Test Point PASS!!!
        [1672000 ns] Test is running, debug_wb_pc = 0xbfc00be0
        [1682000 ns] Test is running, debug_wb_pc = 0xbfc003ac
----[1687255 ns] Number 8'd78 Functional Test Point PASS!!!
        [1692000 ns] Test is running, debug_wb_pc = 0xbfc0047c
        [1702000 ns] Test is running, debug_wb_pc = 0xbfc003b4
----[1702545 ns] Number 8'd79 Functional Test Point PASS!!!
        [1712000 ns] Test is running, debug_wb_pc = 0xbfc003bc
----[1717835 ns] Number 8'd80 Functional Test Point PASS!!!
        [1722000 ns] Test is running, debug_wb_pc = 0xbfc00478
        [1732000 ns] Test is running, debug_wb_pc = 0xbfc7a72c
----[1733125 ns] Number 8'd81 Functional Test Point PASS!!!
        [1742000 ns] Test is running, debug_wb_pc = 0xbfc004c4
----[1748415 ns] Number 8'd82 Functional Test Point PASS!!!
        [1752000 ns] Test is running, debug_wb_pc = 0xbfc0048c
        [1762000 ns] Test is running, debug_wb_pc = 0xbfc005ac
----[1763705 ns] Number 8'd83 Functional Test Point PASS!!!
        [1772000 ns] Test is running, debug_wb_pc = 0xbfc88290
----[1779005 ns] Number 8'd84 Functional Test Point PASS!!!
        [1782000 ns] Test is running, debug_wb_pc = 0xbfc00484
        [1792000 ns] Test is running, debug_wb_pc = 0xbfc00688
----[1794315 ns] Number 8'd85 Functional Test Point PASS!!!
        [1802000 ns] Test is running, debug_wb_pc = 0xbfc289b8
----[1809615 ns] Number 8'd86 Functional Test Point PASS!!!
        [1812000 ns] Test is running, debug_wb_pc = 0xbfc00458
        [1822000 ns] Test is running, debug_wb_pc = 0xbfc006a0
----[1824915 ns] Number 8'd87 Functional Test Point PASS!!!
        [1832000 ns] Test is running, debug_wb_pc = 0xbfc00384
----[1840215 ns] Number 8'd88 Functional Test Point PASS!!!
        [1842000 ns] Test is running, debug_wb_pc = 0xbfc0044c
        [1852000 ns] Test is running, debug_wb_pc = 0xbfc006b4
----[1855515 ns] Number 8'd89 Functional Test Point PASS!!!
==============================================================
gettrace end!
----Succeed in generating trace file!
$finish called at time : 1856145 ns : File "D:/nscscc-group/func_test_v0.01/cpu132_gettrace/testbench/tb_top.v" Line 221
run: Time (s): cpu = 00:01:32 ; elapsed = 00:03:02 . Memory (MB): peak = 1279.668 ; gain = 9.594

lw sw,CPU设计实战,fpga,mips
golden_trace.txt也自动更新了。
这里省略第二种验证方法,懒得看仿真波形了。

上板验证(89个功能点测试)

测试了一下我的烂笔记本电脑和移动硬盘以及烂扩展坞都是没有问题的,龙芯的实验板子也没有问题。
lw sw,CPU设计实战,fpga,mipslw sw,CPU设计实战,fpga,mips这篇里面测试的是龙芯发布包里面的完整且正确的代码。
这里就先测一下89个功能测试,记忆力测试什么的,下一个再写。。文章来源地址https://www.toymoban.com/news/detail-520722.html

到了这里,关于【CPU设计实战】简单流水线CPU设计的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • CI/CD流水线实战

    不知道为什么,现在什么技术都想学,因为我觉得我遇到了技术的壁垒,大的项目接触不到,做的项目一个字 辣* 。所以,整个人心浮气躁,我已经得通过每天的骑行和长跑缓解这种浮躁了。一个周末,我再次宅在了家里,学习了一下 CICD 。 先分享一下 shigen 的学习视频资源

    2024年02月12日
    浏览(65)
  • 8位加法器的流水线设计(2级流水、四级流水)

    思考:流水线的设计是为了提高频率,在一个耗时比较长的组合逻辑中,加入寄存器, 可以将这个较长的组合逻辑分裂几份,从而提升主频,缺点是增加了寄存器的资源。 二级流水线的加法器的设计思想如下: 在第一个周期完成低四位的加法计算,使用一个四位加法器即可

    2024年02月11日
    浏览(46)
  • Verilog流水线设计——Pipeline

    在工程师实际开发过程中,可能会经常遇到这样的需求:数据从数据源端不断地持续输入FPGA,FPGA需要对数据进行处理,最后将处理好的数据输出至客户端。 在数据处理过程中,可能需要一系列的处理步骤。比如常规的信号进行处理步骤有(这里的处理步骤只是举个例子):

    2024年02月08日
    浏览(50)
  • 【软件架构】流水线设计模式

    流水线模式 流水线 模式是一种软件设计模式,它提供了构建 和执行 一系列 操作的能力。 此模式最好与 插件 模式结合使用,以便在应用程序启动时 动态 构建流水线。 顺序 流水线的最基本实现是一个简单的操作序列。 可以调用 操作 的接口来 处理 数据。 流水线一个一个

    2024年02月10日
    浏览(49)
  • 实战:Docker+Jenkins+Gitee构建CICD流水线

    持续集成和持续交付一直是当下流行的开发运维方式,CICD省去了大量的运维时间,也能够提高开发者代码集成规范。开发者在开发完需求功能后可以直接提交到gitee,然后jenkins直接进行代码编译和一体化流水线部署。通过流水线部署可以极大的提高devops效率,也是企业信息自

    2024年02月14日
    浏览(55)
  • Docker+Jenkins(blueocean)+Gitee构建CICD流水线实战

    vim /etc/profile export JAVA_HOME=/home/jdk/jdk1.8.0_301 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin source /etc/profile vim /etc/profile export MAVEN_HOME=/home/maven/apache-maven-3.8.6 export PATH=$PATH:$MAVEN_HOME/bin source /etc/profile docker pull jenkinsci/blue

    2024年02月11日
    浏览(80)
  • 【【verilog典型电路设计之流水线结构】】

    下图是一个4位的乘法器结构,用verilog HDL 设计一个两级流水线加法器树4位乘法器 对于流水线结构 其实需要做的是在每级之间增加一个暂存的数据用来存储 我们得到的东西 我们一般来说会通过在每一级之间插入D触发器来保证数据的联通 通过在第一级和第二级,第二级和第

    2024年02月12日
    浏览(39)
  • 南京观海微电子----Verilog流水线设计——Pipeline

    1.  前言 在工程师实际开发过程中,可能会经常遇到这样的需求:数据从数据源端不断地持续输入FPGA,FPGA需要对数据进行处理,最后将处理好的数据输出至客户端。 在数据处理过程中,可能需要一系列的处理步骤。比如常规的信号进行处理步骤有(这里的处理步骤只是举个

    2024年01月19日
    浏览(43)
  • 从零开始设计RISC-V处理器——五级流水线之数据通路的设计

    (一)从零开始设计RISC-V处理器——指令系统 (二)从零开始设计RISC-V处理器——单周期处理器的设计 (三)从零开始设计RISC-V处理器——单周期处理器的仿真 (四)从零开始设计RISC-V处理器——ALU的优化 (五)从零开始设计RISC-V处理器——五级流水线之数据通路的设计

    2024年02月08日
    浏览(53)
  • 【计组实验】基于Verilog的多周期非流水线MIPS处理器设计

    设计多周期非流水线MIPS处理器,包括: 完成多周期MIPS处理器的Verilog代码; 在Vivado软件上进行仿真; 编写MIPS代码验证MIPS处理器; 相关代码及资源的下载地址如下: 本实验的Vivado工程文件和实验文档:Multi-Cycle MIPS Processor.zip(272KB) QtSpim 9.1.23和Vivado 2019.2的安装包:QtSpim Viv

    2024年02月11日
    浏览(47)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包