From 111e02677dee053776c6effa43708c262e5e620e Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Fri, 11 Feb 2022 13:58:45 -0600 Subject: [PATCH 01/10] Fixed ila's config. --- fpga/constraints/debug2.xdc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fpga/constraints/debug2.xdc b/fpga/constraints/debug2.xdc index 19d0eae5f..9c3e5a5f6 100644 --- a/fpga/constraints/debug2.xdc +++ b/fpga/constraints/debug2.xdc @@ -553,9 +553,9 @@ set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe119] connect_debug_port u_ila_0/probe119 [get_nets [list wallypipelinedsoc/core/lsu/DTLBWriteM]] create_debug_port u_ila_0 probe -set_property port_width 11 [get_debug_ports u_ila_0/probe120] +set_property port_width 4 [get_debug_ports u_ila_0/probe120] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe120] -connect_debug_port u_ila_0/probe120 [get_nets [list {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[0]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[1]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[2]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[3]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[4]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[5]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[6]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[7]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[8]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[9]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[10]}]] +connect_debug_port u_ila_0/probe120 [get_nets [list {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[0]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[1]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[2]} {wallypipelinedsoc/core/lsu/VIRTMEM_SUPPORTED.lsuvirtmem/hptw/WalkerState[3]}]] create_debug_port u_ila_0 probe From dc74a6ba9c6c53abcb20a6de3869a28a83be1be5 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Mon, 28 Mar 2022 10:23:20 -0500 Subject: [PATCH 02/10] Temporary change of plic uart id to 10. --- pipelined/config/fpga/wally-config.vh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelined/config/fpga/wally-config.vh b/pipelined/config/fpga/wally-config.vh index 2e8063e23..a1dc805b3 100644 --- a/pipelined/config/fpga/wally-config.vh +++ b/pipelined/config/fpga/wally-config.vh @@ -123,7 +123,7 @@ // Interrupt configuration `define PLIC_NUM_SRC 53 -`define PLIC_UART_ID 4 +`define PLIC_UART_ID 10 `define TWO_BIT_PRELOAD "../config/fpga/twoBitPredictor.txt" `define BTB_PRELOAD "../config/fpga/BTBPredictor.txt" From f818b2a4283b156b172fc562e901d46312d20aee Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Mon, 28 Mar 2022 10:52:26 -0500 Subject: [PATCH 03/10] Updated debug2.xdc ila constraints to match rtl. --- fpga/constraints/debug2.xdc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fpga/constraints/debug2.xdc b/fpga/constraints/debug2.xdc index 9c3e5a5f6..4ace8b682 100644 --- a/fpga/constraints/debug2.xdc +++ b/fpga/constraints/debug2.xdc @@ -41,7 +41,7 @@ connect_debug_port u_ila_0/probe5 [get_nets [list {wallypipelinedsoc/core/ReadDa create_debug_port u_ila_0 probe set_property port_width 64 [get_debug_ports u_ila_0/probe6] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe6] -connect_debug_port u_ila_0/probe6 [get_nets [list {wallypipelinedsoc/core/WriteDataM[0]} {wallypipelinedsoc/core/WriteDataM[1]} {wallypipelinedsoc/core/WriteDataM[2]} {wallypipelinedsoc/core/WriteDataM[3]} {wallypipelinedsoc/core/WriteDataM[4]} {wallypipelinedsoc/core/WriteDataM[5]} {wallypipelinedsoc/core/WriteDataM[6]} {wallypipelinedsoc/core/WriteDataM[7]} {wallypipelinedsoc/core/WriteDataM[8]} {wallypipelinedsoc/core/WriteDataM[9]} {wallypipelinedsoc/core/WriteDataM[10]} {wallypipelinedsoc/core/WriteDataM[11]} {wallypipelinedsoc/core/WriteDataM[12]} {wallypipelinedsoc/core/WriteDataM[13]} {wallypipelinedsoc/core/WriteDataM[14]} {wallypipelinedsoc/core/WriteDataM[15]} {wallypipelinedsoc/core/WriteDataM[16]} {wallypipelinedsoc/core/WriteDataM[17]} {wallypipelinedsoc/core/WriteDataM[18]} {wallypipelinedsoc/core/WriteDataM[19]} {wallypipelinedsoc/core/WriteDataM[20]} {wallypipelinedsoc/core/WriteDataM[21]} {wallypipelinedsoc/core/WriteDataM[22]} {wallypipelinedsoc/core/WriteDataM[23]} {wallypipelinedsoc/core/WriteDataM[24]} {wallypipelinedsoc/core/WriteDataM[25]} {wallypipelinedsoc/core/WriteDataM[26]} {wallypipelinedsoc/core/WriteDataM[27]} {wallypipelinedsoc/core/WriteDataM[28]} {wallypipelinedsoc/core/WriteDataM[29]} {wallypipelinedsoc/core/WriteDataM[30]} {wallypipelinedsoc/core/WriteDataM[31]} {wallypipelinedsoc/core/WriteDataM[32]} {wallypipelinedsoc/core/WriteDataM[33]} {wallypipelinedsoc/core/WriteDataM[34]} {wallypipelinedsoc/core/WriteDataM[35]} {wallypipelinedsoc/core/WriteDataM[36]} {wallypipelinedsoc/core/WriteDataM[37]} {wallypipelinedsoc/core/WriteDataM[38]} {wallypipelinedsoc/core/WriteDataM[39]} {wallypipelinedsoc/core/WriteDataM[40]} {wallypipelinedsoc/core/WriteDataM[41]} {wallypipelinedsoc/core/WriteDataM[42]} {wallypipelinedsoc/core/WriteDataM[43]} {wallypipelinedsoc/core/WriteDataM[44]} {wallypipelinedsoc/core/WriteDataM[45]} {wallypipelinedsoc/core/WriteDataM[46]} {wallypipelinedsoc/core/WriteDataM[47]} {wallypipelinedsoc/core/WriteDataM[48]} {wallypipelinedsoc/core/WriteDataM[49]} {wallypipelinedsoc/core/WriteDataM[50]} {wallypipelinedsoc/core/WriteDataM[51]} {wallypipelinedsoc/core/WriteDataM[52]} {wallypipelinedsoc/core/WriteDataM[53]} {wallypipelinedsoc/core/WriteDataM[54]} {wallypipelinedsoc/core/WriteDataM[55]} {wallypipelinedsoc/core/WriteDataM[56]} {wallypipelinedsoc/core/WriteDataM[57]} {wallypipelinedsoc/core/WriteDataM[58]} {wallypipelinedsoc/core/WriteDataM[59]} {wallypipelinedsoc/core/WriteDataM[60]} {wallypipelinedsoc/core/WriteDataM[61]} {wallypipelinedsoc/core/WriteDataM[62]} {wallypipelinedsoc/core/WriteDataM[63]} ]] +connect_debug_port u_ila_0/probe6 [get_nets [list {wallypipelinedsoc/core/lsu/WriteDataM[0]} {wallypipelinedsoc/core/lsu/WriteDataM[1]} {wallypipelinedsoc/core/lsu/WriteDataM[2]} {wallypipelinedsoc/core/lsu/WriteDataM[3]} {wallypipelinedsoc/core/lsu/WriteDataM[4]} {wallypipelinedsoc/core/lsu/WriteDataM[5]} {wallypipelinedsoc/core/lsu/WriteDataM[6]} {wallypipelinedsoc/core/lsu/WriteDataM[7]} {wallypipelinedsoc/core/lsu/WriteDataM[8]} {wallypipelinedsoc/core/lsu/WriteDataM[9]} {wallypipelinedsoc/core/lsu/WriteDataM[10]} {wallypipelinedsoc/core/lsu/WriteDataM[11]} {wallypipelinedsoc/core/lsu/WriteDataM[12]} {wallypipelinedsoc/core/lsu/WriteDataM[13]} {wallypipelinedsoc/core/lsu/WriteDataM[14]} {wallypipelinedsoc/core/lsu/WriteDataM[15]} {wallypipelinedsoc/core/lsu/WriteDataM[16]} {wallypipelinedsoc/core/lsu/WriteDataM[17]} {wallypipelinedsoc/core/lsu/WriteDataM[18]} {wallypipelinedsoc/core/lsu/WriteDataM[19]} {wallypipelinedsoc/core/lsu/WriteDataM[20]} {wallypipelinedsoc/core/lsu/WriteDataM[21]} {wallypipelinedsoc/core/lsu/WriteDataM[22]} {wallypipelinedsoc/core/lsu/WriteDataM[23]} {wallypipelinedsoc/core/lsu/WriteDataM[24]} {wallypipelinedsoc/core/lsu/WriteDataM[25]} {wallypipelinedsoc/core/lsu/WriteDataM[26]} {wallypipelinedsoc/core/lsu/WriteDataM[27]} {wallypipelinedsoc/core/lsu/WriteDataM[28]} {wallypipelinedsoc/core/lsu/WriteDataM[29]} {wallypipelinedsoc/core/lsu/WriteDataM[30]} {wallypipelinedsoc/core/lsu/WriteDataM[31]} {wallypipelinedsoc/core/lsu/WriteDataM[32]} {wallypipelinedsoc/core/lsu/WriteDataM[33]} {wallypipelinedsoc/core/lsu/WriteDataM[34]} {wallypipelinedsoc/core/lsu/WriteDataM[35]} {wallypipelinedsoc/core/lsu/WriteDataM[36]} {wallypipelinedsoc/core/lsu/WriteDataM[37]} {wallypipelinedsoc/core/lsu/WriteDataM[38]} {wallypipelinedsoc/core/lsu/WriteDataM[39]} {wallypipelinedsoc/core/lsu/WriteDataM[40]} {wallypipelinedsoc/core/lsu/WriteDataM[41]} {wallypipelinedsoc/core/lsu/WriteDataM[42]} {wallypipelinedsoc/core/lsu/WriteDataM[43]} {wallypipelinedsoc/core/lsu/WriteDataM[44]} {wallypipelinedsoc/core/lsu/WriteDataM[45]} {wallypipelinedsoc/core/lsu/WriteDataM[46]} {wallypipelinedsoc/core/lsu/WriteDataM[47]} {wallypipelinedsoc/core/lsu/WriteDataM[48]} {wallypipelinedsoc/core/lsu/WriteDataM[49]} {wallypipelinedsoc/core/lsu/WriteDataM[50]} {wallypipelinedsoc/core/lsu/WriteDataM[51]} {wallypipelinedsoc/core/lsu/WriteDataM[52]} {wallypipelinedsoc/core/lsu/WriteDataM[53]} {wallypipelinedsoc/core/lsu/WriteDataM[54]} {wallypipelinedsoc/core/lsu/WriteDataM[55]} {wallypipelinedsoc/core/lsu/WriteDataM[56]} {wallypipelinedsoc/core/lsu/WriteDataM[57]} {wallypipelinedsoc/core/lsu/WriteDataM[58]} {wallypipelinedsoc/core/lsu/WriteDataM[59]} {wallypipelinedsoc/core/lsu/WriteDataM[60]} {wallypipelinedsoc/core/lsu/WriteDataM[61]} {wallypipelinedsoc/core/lsu/WriteDataM[62]} {wallypipelinedsoc/core/lsu/WriteDataM[63]} ]] create_debug_port u_ila_0 probe set_property port_width 64 [get_debug_ports u_ila_0/probe7] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe7] @@ -155,6 +155,7 @@ create_debug_port u_ila_0 probe set_property port_width 1 [get_debug_ports u_ila_0/probe34] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe34] connect_debug_port u_ila_0/probe34 [get_nets [list wallypipelinedsoc/core/lsu/LSUBusWrite ]] + create_debug_port u_ila_0 probe set_property port_width 1 [get_debug_ports u_ila_0/probe35] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe35] @@ -195,10 +196,12 @@ create_debug_port u_ila_0 probe set_property port_width 1 [get_debug_ports u_ila_0/probe44] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe44] connect_debug_port u_ila_0/probe44 [get_nets [list wallypipelinedsoc/core/priv.priv/trap/InstrPageFaultM ]] + create_debug_port u_ila_0 probe set_property port_width 1 [get_debug_ports u_ila_0/probe45] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe45] connect_debug_port u_ila_0/probe45 [get_nets [list wallypipelinedsoc/core/InstrValidM ]] + create_debug_port u_ila_0 probe set_property port_width 1 [get_debug_ports u_ila_0/probe46] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe46] From b3506c755aa26d7b655a867d1bb9ecd5399a7562 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Mon, 28 Mar 2022 17:04:58 -0500 Subject: [PATCH 04/10] test. --- fpga/generator/wally.tcl | 3 ++ pipelined/src/uncore/ram.sv | 84 ++++++++++++++++++------------------- 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/fpga/generator/wally.tcl b/fpga/generator/wally.tcl index 824574d9c..60666077a 100644 --- a/fpga/generator/wally.tcl +++ b/fpga/generator/wally.tcl @@ -52,6 +52,9 @@ report_utilization -hierarchical -file re report_cdc -file reports/cdc.rpt report_clock_interaction -file reports/clock_interaction.rpt +write_verilog -force -mode funcsim sim/syn-funcsim.v + + source ../constraints/debug2.xdc diff --git a/pipelined/src/uncore/ram.sv b/pipelined/src/uncore/ram.sv index e9b0af32d..61dec5a5c 100644 --- a/pipelined/src/uncore/ram.sv +++ b/pipelined/src/uncore/ram.sv @@ -60,48 +60,48 @@ module ram #(parameter BASE=0, RANGE = 65535) ( // *** need to address this preload for fpga. It should work as a preload file // but for some reason vivado is not synthesizing the preload. //$readmemh(PRELOAD, RAM); - RAM[0] = 64'h94e1819300002197; - RAM[1] = 64'h4281420141014081; - RAM[2] = 64'h4481440143814301; - RAM[3] = 64'h4681460145814501; - RAM[4] = 64'h4881480147814701; - RAM[5] = 64'h4a814a0149814901; - RAM[6] = 64'h4c814c014b814b01; - RAM[7] = 64'h4e814e014d814d01; - RAM[8] = 64'h0110011b4f814f01; - RAM[9] = 64'h059b45011161016e; - RAM[10] = 64'h0004063705fe0010; - RAM[11] = 64'h05a000ef8006061b; - RAM[12] = 64'h0ff003930000100f; - RAM[13] = 64'h4e952e3110060e37; - RAM[14] = 64'hc602829b0053f2b7; - RAM[15] = 64'h2023fe02dfe312fd; - RAM[16] = 64'h829b0053f2b7007e; - RAM[17] = 64'hfe02dfe312fdc602; - RAM[18] = 64'h4de31efd000e2023; - RAM[19] = 64'h059bf1402573fdd0; - RAM[20] = 64'h0000061705e20870; - RAM[21] = 64'h0010029b01260613; - RAM[22] = 64'h11010002806702fe; - RAM[23] = 64'h84b2842ae426e822; - RAM[24] = 64'h892ee04aec064505; - RAM[25] = 64'h06e000ef07e000ef; - RAM[26] = 64'h979334fd02905563; - RAM[27] = 64'h07930177d4930204; - RAM[28] = 64'h4089093394be2004; - RAM[29] = 64'h04138522008905b3; - RAM[30] = 64'h19e3014000ef2004; - RAM[31] = 64'h64a2644260e2fe94; - RAM[32] = 64'h6749808261056902; - RAM[33] = 64'hdfed8b8510472783; - RAM[34] = 64'h2423479110a73823; - RAM[35] = 64'h10472783674910f7; - RAM[36] = 64'h20058693ffed8b89; - RAM[37] = 64'h05a1118737836749; - RAM[38] = 64'hfed59be3fef5bc23; - RAM[39] = 64'h1047278367498082; - RAM[40] = 64'h67c98082dfed8b85; - RAM[41] = 64'h0000808210a7a023; + RAM[BASE+0] = 64'h94e1819300002197; + RAM[BASE+1] = 64'h4281420141014081; + RAM[BASE+2] = 64'h4481440143814301; + RAM[BASE+3] = 64'h4681460145814501; + RAM[BASE+4] = 64'h4881480147814701; + RAM[BASE+5] = 64'h4a814a0149814901; + RAM[BASE+6] = 64'h4c814c014b814b01; + RAM[BASE+7] = 64'h4e814e014d814d01; + RAM[BASE+8] = 64'h0110011b4f814f01; + RAM[BASE+9] = 64'h059b45011161016e; + RAM[BASE+10] = 64'h0004063705fe0010; + RAM[BASE+11] = 64'h05a000ef8006061b; + RAM[BASE+12] = 64'h0ff003930000100f; + RAM[BASE+13] = 64'h4e952e3110060e37; + RAM[BASE+14] = 64'hc602829b0053f2b7; + RAM[BASE+15] = 64'h2023fe02dfe312fd; + RAM[BASE+16] = 64'h829b0053f2b7007e; + RAM[BASE+17] = 64'hfe02dfe312fdc602; + RAM[BASE+18] = 64'h4de31efd000e2023; + RAM[BASE+19] = 64'h059bf1402573fdd0; + RAM[BASE+20] = 64'h0000061705e20870; + RAM[BASE+21] = 64'h0010029b01260613; + RAM[BASE+22] = 64'h11010002806702fe; + RAM[BASE+23] = 64'h84b2842ae426e822; + RAM[BASE+24] = 64'h892ee04aec064505; + RAM[BASE+25] = 64'h06e000ef07e000ef; + RAM[BASE+26] = 64'h979334fd02905563; + RAM[BASE+27] = 64'h07930177d4930204; + RAM[BASE+28] = 64'h4089093394be2004; + RAM[BASE+29] = 64'h04138522008905b3; + RAM[BASE+30] = 64'h19e3014000ef2004; + RAM[BASE+31] = 64'h64a2644260e2fe94; + RAM[BASE+32] = 64'h6749808261056902; + RAM[BASE+33] = 64'hdfed8b8510472783; + RAM[BASE+34] = 64'h2423479110a73823; + RAM[BASE+35] = 64'h10472783674910f7; + RAM[BASE+36] = 64'h20058693ffed8b89; + RAM[BASE+37] = 64'h05a1118737836749; + RAM[BASE+38] = 64'hfed59be3fef5bc23; + RAM[BASE+39] = 64'h1047278367498082; + RAM[BASE+40] = 64'h67c98082dfed8b85; + RAM[BASE+41] = 64'h0000808210a7a023; end // initial begin end // if (FPGA) From 057ee56d7eaccc0f737396137eaccd09023a8c56 Mon Sep 17 00:00:00 2001 From: David Harris Date: Tue, 29 Mar 2022 19:16:41 +0000 Subject: [PATCH 05/10] Updated synthesis to look at fma16.v, other scripts to use fma16.v instead of fma16.sv --- pipelined/src/fma/fma.do | 2 +- pipelined/src/fma/lint-fma | 2 +- synthDC/scripts/synth.tcl | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pipelined/src/fma/fma.do b/pipelined/src/fma/fma.do index 9a7de1267..6e6863d5f 100644 --- a/pipelined/src/fma/fma.do +++ b/pipelined/src/fma/fma.do @@ -8,7 +8,7 @@ onbreak {resume} # create library vlib worklib -vlog -lint -work worklib fma16.sv testbench.v +vlog -lint -work worklib fma16.v testbench.v vopt +acc worklib.testbench_fma16 -work worklib -o testbenchopt vsim -lib worklib testbenchopt diff --git a/pipelined/src/fma/lint-fma b/pipelined/src/fma/lint-fma index 462d53508..290bf69ff 100755 --- a/pipelined/src/fma/lint-fma +++ b/pipelined/src/fma/lint-fma @@ -5,4 +5,4 @@ export PATH=$PATH:/usr/local/bin/ verilator=`which verilator` basepath=$(dirname $0)/.. -$verilator --lint-only --top-module fma16 fma16.sv +$verilator --lint-only --top-module fma16 fma16.v diff --git a/synthDC/scripts/synth.tcl b/synthDC/scripts/synth.tcl index 3146e14ed..d79009fe1 100755 --- a/synthDC/scripts/synth.tcl +++ b/synthDC/scripts/synth.tcl @@ -28,6 +28,9 @@ eval file copy -force [glob ${hdl_src}/../config/shared/*.vh] {hdl/} eval file copy -force [glob ${hdl_src}/*/*.sv] {hdl/} eval file copy -force [glob ${hdl_src}/*/flop/*.sv] {hdl/} +# Only for FMA class project; comment out when done +eval file copy -force [glob ${hdl_src}/fma/fma16.v] {hdl/} + # Enables name mapping if { $saifpower == 1 } { saif_map -start From 9f9a273d2c3df02bb13617c9c326031d864f1686 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Wed, 30 Mar 2022 17:29:48 -0500 Subject: [PATCH 06/10] Added bootrom.txt. --- fpga/generator/bootrom.txt | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 fpga/generator/bootrom.txt diff --git a/fpga/generator/bootrom.txt b/fpga/generator/bootrom.txt new file mode 100644 index 000000000..b49f25c09 --- /dev/null +++ b/fpga/generator/bootrom.txt @@ -0,0 +1,42 @@ +94e1819300002197 +4281420141014081 +4481440143814301 +4681460145814501 +4881480147814701 +4a814a0149814901 +4c814c014b814b01 +4e814e014d814d01 +0110011b4f814f01 +059b45011161016e +0004063705fe0010 +05a000ef8006061b +0ff003930000100f +4e952e3110060e37 +c602829b0053f2b7 +2023fe02dfe312fd +829b0053f2b7007e +fe02dfe312fdc602 +4de31efd000e2023 +059bf1402573fdd0 +0000061705e20870 +0010029b01260613 +11010002806702fe +84b2842ae426e822 +892ee04aec064505 +06e000ef07e000ef +979334fd02905563 +07930177d4930204 +4089093394be2004 +04138522008905b3 +19e3014000ef2004 +64a2644260e2fe94 +6749808261056902 +dfed8b8510472783 +2423479110a73823 +10472783674910f7 +20058693ffed8b89 +05a1118737836749 +fed59be3fef5bc23 +1047278367498082 +67c98082dfed8b85 +0000808210a7a023 From 4f1258043d26fd08564aa53cb31855b2e04e72c1 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Wed, 30 Mar 2022 17:48:44 -0500 Subject: [PATCH 07/10] Updated constraints file. --- fpga/constraints/debug2.xdc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpga/constraints/debug2.xdc b/fpga/constraints/debug2.xdc index 4ace8b682..7cc4f8d1d 100644 --- a/fpga/constraints/debug2.xdc +++ b/fpga/constraints/debug2.xdc @@ -122,7 +122,7 @@ connect_debug_port u_ila_0/probe25 [get_nets [list {wallypipelinedsoc/uncore/sdc create_debug_port u_ila_0 probe set_property port_width 12 [get_debug_ports u_ila_0/probe26] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe26] -connect_debug_port u_ila_0/probe26 [get_nets [list {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[0]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[1]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[2]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[3]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[4]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[5]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[6]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[7]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[8]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[9]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[10]} {wallypipelinedsoc/core/priv.priv/trap/PendingIntsM[11]} ]] +connect_debug_port u_ila_0/probe26 [get_nets [list {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[0]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[1]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[2]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[3]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[4]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[5]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[6]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[7]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[8]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[9]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[10]} {wallypipelinedsoc/core/priv.priv/trap/MPendingIntsM[11]} ]] create_debug_port u_ila_0 probe set_property port_width 64 [get_debug_ports u_ila_0/probe27] set_property PROBE_TYPE DATA_AND_TRIGGER [get_debug_ports u_ila_0/probe27] From 93d6b2fb623d0c020f914b8ddefc06a25546f555 Mon Sep 17 00:00:00 2001 From: David Harris Date: Thu, 31 Mar 2022 00:51:33 +0000 Subject: [PATCH 08/10] Added synthesis script for fma16 --- pipelined/src/fma/synth | 1 + 1 file changed, 1 insertion(+) create mode 100755 pipelined/src/fma/synth diff --git a/pipelined/src/fma/synth b/pipelined/src/fma/synth new file mode 100755 index 000000000..0ced41c8d --- /dev/null +++ b/pipelined/src/fma/synth @@ -0,0 +1 @@ +make -C ../../../synthDC synth DESIGN=fma16 From dc48d84dd6becf6820b9faa7c028787b8c87f71b Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Thu, 31 Mar 2022 11:31:52 -0500 Subject: [PATCH 09/10] Modified clint to support all byte write sizes. --- pipelined/src/generic/flop/bram2p1r1w.sv | 18 +++++++++++-- pipelined/src/mmu/adrdecs.sv | 4 +-- pipelined/src/uncore/clint.sv | 34 +++++++++++++++++++----- pipelined/src/uncore/uncore.sv | 2 +- 4 files changed, 46 insertions(+), 12 deletions(-) diff --git a/pipelined/src/generic/flop/bram2p1r1w.sv b/pipelined/src/generic/flop/bram2p1r1w.sv index 89fe432a9..7bb79efe5 100644 --- a/pipelined/src/generic/flop/bram2p1r1w.sv +++ b/pipelined/src/generic/flop/bram2p1r1w.sv @@ -54,9 +54,22 @@ module bram2p1r1w input logic [ADDR_WIDTH-1:0] addrB, input logic [DATA_WIDTH-1:0] dinB ); - // Core Memory + + + + // *** TODO. +/* -----\/----- EXCLUDED -----\/----- + if(`SRAM) begin + // instanciate SRAM model + // need multiple SRAM instances to map into correct dimentions. + // also map the byte write enables onto bit write enables. + end else begin // FPGA or infered flip flop memory + // Core Memory + end + -----/\----- EXCLUDED -----/\----- */ + logic [DATA_WIDTH-1:0] RAM [(2**ADDR_WIDTH)-1:0]; - integer i; + integer i; initial begin if(PRELOAD_ENABLED) @@ -79,4 +92,5 @@ module bram2p1r1w end end end + endmodule // bytewrite_tdp_ram_rf diff --git a/pipelined/src/mmu/adrdecs.sv b/pipelined/src/mmu/adrdecs.sv index 5464f4ac6..0104ca578 100644 --- a/pipelined/src/mmu/adrdecs.sv +++ b/pipelined/src/mmu/adrdecs.sv @@ -37,7 +37,6 @@ module adrdecs ( input logic [1:0] Size, output logic [8:0] SelRegions ); - logic [3:0] clintaccesssize; // Determine which region of physical memory (if any) is being accessed // *** eventually uncomment Access signals @@ -45,8 +44,7 @@ module adrdecs ( adrdec boottimdec(PhysicalAddress, `BOOTROM_BASE, `BOOTROM_RANGE, `BOOTROM_SUPPORTED, /*1'b1*/AccessRX, Size, 4'b1111, SelRegions[6]); adrdec timdec(PhysicalAddress, `RAM_BASE, `RAM_RANGE, `RAM_SUPPORTED, /*1'b1*/AccessRWX, Size, 4'b1111, SelRegions[5]); - assign clintaccesssize = (`XLEN==64) ? 4'b1000 : 4'b0100; - adrdec clintdec(PhysicalAddress, `CLINT_BASE, `CLINT_RANGE, `CLINT_SUPPORTED, AccessRW, Size, clintaccesssize, SelRegions[4]); + adrdec clintdec(PhysicalAddress, `CLINT_BASE, `CLINT_RANGE, `CLINT_SUPPORTED, AccessRW, Size, 4'b1111, SelRegions[4]); adrdec gpiodec(PhysicalAddress, `GPIO_BASE, `GPIO_RANGE, `GPIO_SUPPORTED, AccessRW, Size, 4'b0100, SelRegions[3]); adrdec uartdec(PhysicalAddress, `UART_BASE, `UART_RANGE, `UART_SUPPORTED, AccessRW, Size, 4'b0001, SelRegions[2]); adrdec plicdec(PhysicalAddress, `PLIC_BASE, `PLIC_RANGE, `PLIC_SUPPORTED, AccessRW, Size, 4'b0100, SelRegions[1]); diff --git a/pipelined/src/uncore/clint.sv b/pipelined/src/uncore/clint.sv index be40d1521..f3ee4f5c1 100644 --- a/pipelined/src/uncore/clint.sv +++ b/pipelined/src/uncore/clint.sv @@ -35,6 +35,7 @@ module clint ( input logic HCLK, HRESETn, TIMECLK, input logic HSELCLINT, input logic [15:0] HADDR, + input logic [3:0] HSIZED, input logic HWRITE, input logic [`XLEN-1:0] HWDATA, input logic HREADY, @@ -50,6 +51,8 @@ module clint ( logic memwrite; logic initTrans; logic [63:0] MTIMECMP; + logic [`XLEN/8-1:0] ByteMaskM; + integer i; assign initTrans = HREADY & HSELCLINT & (HTRANS != 2'b00); // entryd and memwrite are delayed by a cycle because AHB controller waits a cycle before outputting write data @@ -63,6 +66,9 @@ module clint ( if (`XLEN==64) assign #2 entry = {HADDR[15:3], 3'b000}; else assign #2 entry = {HADDR[15:2], 2'b00}; + swbytemask swbytemask(.HSIZED, .HADDRD(entryd[2:0]), .ByteMask(ByteMaskM)); + + // DH 2/20/21: Eventually allow MTIME to run off a separate clock // This will require synchronizing MTIME to the system clock // before it is read or compared to MTIMECMP. @@ -86,7 +92,11 @@ module clint ( // MTIMECMP is not reset end else if (memwrite) begin if (entryd == 16'h0000) MSIP <= HWDATA[0]; - if (entryd == 16'h4000) MTIMECMP <= HWDATA; + if (entryd == 16'h4000) begin + for(i=0;i<`XLEN/8;i++) + if(ByteMaskM[i]) + MTIMECMP[i*8 +: 8] <= HWDATA[i*8 +: 8]; + end end // eventually replace MTIME logic below with timereg @@ -98,7 +108,9 @@ module clint ( // MTIMECMP is not reset end else if (memwrite & entryd == 16'hBFF8) begin // MTIME Counter. Eventually change this to run off separate clock. Synchronization then needed - MTIME <= HWDATA; + for(i=0;i<`XLEN/8;i++) + if(ByteMaskM[i]) + MTIME[i*8 +: 8] <= HWDATA[i*8 +: 8]; end else MTIME <= MTIME + 1; end else begin:clint // 32-bit always @(posedge HCLK) begin @@ -118,8 +130,14 @@ module clint ( // MTIMECMP is not reset ***? end else if (memwrite) begin if (entryd == 16'h0000) MSIP <= HWDATA[0]; - if (entryd == 16'h4000) MTIMECMP[31:0] <= HWDATA; - if (entryd == 16'h4004) MTIMECMP[63:32] <= HWDATA; + if (entryd == 16'h4000) + for(i=0;i<`XLEN/8;i++) + if(ByteMaskM[i]) + MTIMECMP[i*8 +: 8] <= HWDATA[i*8 +: 8]; + if (entryd == 16'h4004) + for(i=0;i<`XLEN/8;i++) + if(ByteMaskM[i]) + MTIMECMP[32 + i*8 +: 8] <= HWDATA[i*8 +: 8]; // MTIME Counter. Eventually change this to run off separate clock. Synchronization then needed end @@ -130,10 +148,14 @@ module clint ( MTIME <= 0; // MTIMECMP is not reset end else if (memwrite & (entryd == 16'hBFF8)) begin - MTIME[31:0] <= HWDATA; + for(i=0;i<`XLEN/8;i++) + if(ByteMaskM[i]) + MTIME[i*8 +: 8] <= HWDATA[i*8 +: 8]; end else if (memwrite & (entryd == 16'hBFFC)) begin // MTIME Counter. Eventually change this to run off separate clock. Synchronization then needed - MTIME[63:32]<= HWDATA; + for(i=0;i<`XLEN/8;i++) + if(ByteMaskM[i]) + MTIME[32 + i*8 +: 8]<= HWDATA[i*8 +: 8]; end else MTIME <= MTIME + 1; end diff --git a/pipelined/src/uncore/uncore.sv b/pipelined/src/uncore/uncore.sv index 17daf50b1..7649745bc 100644 --- a/pipelined/src/uncore/uncore.sv +++ b/pipelined/src/uncore/uncore.sv @@ -116,7 +116,7 @@ module uncore ( clint clint( .HCLK, .HRESETn, .TIMECLK, .HSELCLINT, .HADDR(HADDR[15:0]), .HWRITE, - .HWDATA, .HREADY, .HTRANS, + .HWDATA, .HREADY, .HTRANS, .HSIZED, .HREADCLINT, .HRESPCLINT, .HREADYCLINT, .MTIME(MTIME_CLINT), From 2ed1c9f14ff4b7693c5ce308f9775d64737276b7 Mon Sep 17 00:00:00 2001 From: David Harris Date: Thu, 31 Mar 2022 17:00:38 +0000 Subject: [PATCH 10/10] Added SystemVerilog flag to fma.do so that fma16 compiles properly --- pipelined/src/fma/fma.do | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelined/src/fma/fma.do b/pipelined/src/fma/fma.do index 6e6863d5f..4a23facf6 100644 --- a/pipelined/src/fma/fma.do +++ b/pipelined/src/fma/fma.do @@ -8,7 +8,7 @@ onbreak {resume} # create library vlib worklib -vlog -lint -work worklib fma16.v testbench.v +vlog -lint -sv -work worklib fma16.v testbench.v vopt +acc worklib.testbench_fma16 -work worklib -o testbenchopt vsim -lib worklib testbenchopt