Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
f3d3de9
Initialize base types
BIGWJZ Jul 3, 2024
03eb410
init branch develop
BIGWJZ Jul 4, 2024
765d837
Inplement PCIe Interface Types
BIGWJZ Jul 4, 2024
f259b91
Inplement PCIe Interface Types
BIGWJZ Jul 4, 2024
a4a8d12
update mkChunkComputer
BIGWJZ Jul 5, 2024
2cc532c
Add mkChunkComputeTb and test pass
BIGWJZ Jul 7, 2024
89dfb11
Dynamic TLP Max Payload Size
BIGWJZ Jul 8, 2024
85baea7
Dynamic TLP Max Payload Size
BIGWJZ Jul 8, 2024
00a6386
Test various MPS settings and verify timing
BIGWJZ Jul 9, 2024
5e6b009
Add StreamUtils::StreamConcat
BIGWJZ Jul 10, 2024
75ebadb
a simple test:
BIGWJZ Jul 10, 2024
1b76335
a simple test
BIGWJZ Jul 10, 2024
ebc614f
Test Pass
BIGWJZ Jul 11, 2024
d20503f
Update StreamUtils
BIGWJZ Jul 11, 2024
9c0ac45
Add StreamSplit
BIGWJZ Jul 12, 2024
4f92212
Test StreamUtils Pass
BIGWJZ Jul 13, 2024
44e0f8a
Update all modules according to the review
BIGWJZ Jul 14, 2024
3267090
Update StreaUtils
BIGWJZ Jul 16, 2024
9fb805d
update PcieTypes
BIGWJZ Jul 16, 2024
0c9018d
Add CompleterRequest
BIGWJZ Jul 20, 2024
ddc177a
Fix Types
BIGWJZ Jul 20, 2024
c7d7d77
Add PcieCompleter
BIGWJZ Jul 20, 2024
b70f57d
Add CCDescriptor and modify interface
BIGWJZ Jul 21, 2024
31d1b0f
Update dmac interfaces
BIGWJZ Jul 21, 2024
cc29df5
testDmaCompterRequest
BIGWJZ Jul 21, 2024
27d3953
Add TestDmacVivado for simulation with IP
BIGWJZ Jul 23, 2024
438dda2
Update rawPcie interfaces
BIGWJZ Jul 23, 2024
ec3c3f4
Finish CsrWrRd
BIGWJZ Jul 25, 2024
98c2005
Fix streamUtils and pass all test
BIGWJZ Jul 25, 2024
ac1beec
Add dmaRequester
BIGWJZ Aug 2, 2024
63777bc
Add streamShift
BIGWJZ Aug 5, 2024
0636564
Add streamShift
BIGWJZ Aug 5, 2024
39de089
Add ReqRequestCore
BIGWJZ Aug 6, 2024
7cd136b
Reorganize DmaC2HPipe and PCIe adapter interfaces
BIGWJZ Aug 14, 2024
a84cd31
Reorganize DmaC2HPipe&DmaH2CPipe
BIGWJZ Aug 16, 2024
bc89604
Add RawDmaController Wrapper and a simple cocotb
BIGWJZ Aug 21, 2024
9426c06
Add cocotb testbench
BIGWJZ Aug 27, 2024
db450a5
Pass cocotb write tb
BIGWJZ Aug 30, 2024
1ad356c
Pass straddle mode cocotb test
BIGWJZ Sep 3, 2024
d1f9974
Add H2C functions
BIGWJZ Sep 21, 2024
7af1a43
Add Simple Mode
BIGWJZ Oct 8, 2024
f9e46fa
solve h2c r&w
BIGWJZ Oct 12, 2024
875df73
add cocotb bar tb
BIGWJZ Oct 15, 2024
d4d5a4c
pass simple mode tb
BIGWJZ Oct 16, 2024
15ef729
Add read-write loop tb
BIGWJZ Oct 16, 2024
10666a5
optimize for fully-pipeline
BIGWJZ Oct 28, 2024
35c503d
Add blue-rdma style interface
BIGWJZ Nov 7, 2024
cb50bdc
Add blue-rdma style interface
BIGWJZ Nov 7, 2024
e146e69
avoid same name file in blue-rdma
BIGWJZ Nov 7, 2024
cb2073c
Fix User Bar Problems
BIGWJZ Nov 29, 2024
30f7649
Fix C2HPipe.reshapeMRRS and cocotb.loop
BIGWJZ Dec 3, 2024
0c5ac0d
Fix TlpOutMux
BIGWJZ Dec 3, 2024
3e9e8f6
Add DummyCsr of Bypass Mode
BIGWJZ Dec 6, 2024
9361b16
feat: rewrite cplt buffer
myrfy001 Feb 28, 2025
6edfb09
fixbug: Read stall
myrfy001 Mar 2, 2025
e161014
fix: can test on hardware with vu13p, but still will hang when transf…
myrfy001 Mar 25, 2025
b951c0c
fix: inflight counter width error
myrfy001 Mar 27, 2025
8eb787d
fix: make reshape fully pipelined and fix test blocking bug
myrfy001 Apr 4, 2025
79eca48
update test script
myrfy001 Apr 7, 2025
55f76a1
update dma test hardware module
myrfy001 Apr 7, 2025
be7ab50
fix 2 bugs in stream processing
myrfy001 Apr 7, 2025
1071fc2
add cocotb correctness test
myrfy001 Apr 7, 2025
6eb35db
fixbug: chunk will exceed MPS (TODO: make cocotb check TLP oversize)
myrfy001 Apr 7, 2025
abf8784
feat: add support for tlp attributes, and make test module support mo…
myrfy001 Apr 9, 2025
b9007c2
improve double channel write only test
myrfy001 Apr 10, 2025
79e114e
refactor: add prefix for filenames
myrfy001 Apr 11, 2025
ee999d2
feat: make some input FIFO to LFIFO
myrfy001 Apr 12, 2025
1eab114
make more fifo to LFIFO
myrfy001 Apr 16, 2025
e103aa0
optmize code, merge two module to save latency and resource usage
myrfy001 Apr 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI
on:
pull_request:
branches: [master]
push:
branches: [master]
# CI runs every 12 hours
schedule: [cron: "0 */12 * * *"]

jobs:
ci-check:
name: CI Build and Simulate
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: build and simulate
run : |
./setup.sh
./run.sh
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/build/**
**/verilog/**
**/*.log
img/*.drawio
**/output/**
**/.Xil/**
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/blue_wrapper"]
path = lib/blue_wrapper
url = https://github.com/wengwz/blue-wrapper.git
Empty file modified LICENSE
100644 → 100755
Empty file.
26 changes: 26 additions & 0 deletions Makefile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
TRANSFLAGS = -aggressive-conditions -lift # -split-if
RECOMPILEFLAGS = -u -show-compiles
SCHEDFLAGS = -show-schedule -sched-dot # -show-rule-rel dMemInit_request_put doExecute
# -show-elab-progress
DEBUGFLAGS = -check-assert \
-continue-after-errors \
-keep-fires \
-keep-inlined-boundaries \
-show-method-bvi \
-show-method-conf \
-show-module-use \
-show-range-conflict \
-show-stats \
-warn-action-shadowing \
-warn-method-urgency \
-promote-warnings ALL
VERILOGFLAGS = -verilog -remove-dollar -remove-unused-modules # -use-dpi -verilog-filter cmd
BLUESIMFLAGS = -parallel-sim-link 16 # -systemc
BUILDDIR = build
OUTDIR = -bdir $(BUILDDIR) -info-dir $(BUILDDIR) -simdir $(BUILDDIR) -vdir $(BUILDDIR)
WORKDIR = -fdir $(abspath .)
LIBSRCDIR = $(abspath ../lib/blue_wrapper/src)
BSVSRCDIR = -p +:$(abspath ../src):$(LIBSRCDIR)
DIRFLAGS = $(BSVSRCDIR) $(OUTDIR) $(WORKDIR)
MISCFLAGS = -print-flags -show-timestamps -show-version -steps 6000000 # -D macro
RUNTIMEFLAGS = +RTS -K4095M -RTS
21 changes: 21 additions & 0 deletions Makefile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
TESTDIR ?= $(abspath ../test)
LOGDIR ?= $(abspath ../tmp)

TESTBENCHS = \
TestStreamUtils.bsv \
TestDmaCore.bsv

TestStreamUtils.bsv = mkStreamConcatTb \
mkStreamSplitTb
TestDmaCore.bsv = mkChunkComputerTb

all: $(TESTBENCHS)

%.bsv:
$(foreach testcase, $($@), $(shell cd $(TESTDIR) && make simulate TESTFILE=$@ TOPMODULE=$(testcase) > $(LOGDIR)/$@-$(testcase).log 2>&1))

clean:
rm -f $(LOGDIR)/*.log

.PHONY: all TESTBENCHS %.bsv clean
.DEFAULT_GOAL := all
Empty file modified README.md
100644 → 100755
Empty file.
60 changes: 60 additions & 0 deletions backend/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
include ../Makefile.base

TCLDIR ?= xdc
CLK ?= rdma_clock
OOC ?= 1
VLOGDIR ?= verilog
OUTPUTDIR ?= output
LOGFILE ?= run_vivado.log
RUNTOPHASE ?= synth # synth place route all
# vu13p, u200
TARGETPLATFORM ?= vu13p
# xcvu13p-fhgb2104-2-i, xcu200-fsgd2104-2-e
PARTNAME = xcvu13p-fhgb2104-2-i
TARGETFILE ?= ../src/XilBdmaDmaWrapper.bsv
#MODULE List: mkRawSimpleDmaController mkRawBypassDmaController mkRawTestDmaController
TOPMODULE ?= mkRawTestDmaController

BACKENDDIR ?= .

VERILOG_TOPMODULE ?= top
MAX_NET_PATH_NUM ?= 100000

export DIR_RTL = $(VLOGDIR)
export DIR_BOARD = $(TARGETPLATFORM)
export DIR_XDC = $(TARGETPLATFORM)/$(TCLDIR)
export DIR_OOC_SCRIPTS = $(BACKENDDIR)/ooc_tcl_and_xdc
export DIR_IPS = $(BACKENDDIR)/ips
export DIR_IP_GENERATED = $(BUILDDIR)/ips
export DIR_BSV_GENERATED = $(BACKENDDIR)/verilog
export VERILOG_TOPMODULE
export TARGET_CLOCKS = $(CLK)
export DIR_OUTPUT = $(OUTPUTDIR)
export OOCSYNTH = $(OOC)
export RUNTO = $(RUNTOPHASE)
export PART = $(PARTNAME)
export MAX_NET_PATH_NUM

compile:
mkdir -p $(BUILDDIR)
bsc -elab -sim -verbose $(BLUESIMFLAGS) $(DEBUGFLAGS) $(DIRFLAGS) $(MISCFLAGS) $(RECOMPILEFLAGS) $(RUNTIMEFLAGS) $(SCHEDFLAGS) $(TRANSFLAGS) -g $(TOPMODULE) $(TARGETFILE)

verilog: compile
mkdir -p $(VLOGDIR)
bsc $(VERILOGFLAGS) $(DIRFLAGS) $(MISCFLAGS) $(RECOMPILEFLAGS) $(RUNTIMEFLAGS) $(TRANSFLAGS) -g $(TOPMODULE) $(TARGETFILE)
bluetcl listVlogFiles.tcl -bdir $(BUILDDIR) -vdir $(BUILDDIR) $(TOPMODULE) $(TOPMODULE) | grep -i '\.v' | xargs -I {} cp {} $(VLOGDIR)

vivado:
vivado -mode tcl -nolog -nojournal -source ./build_top.tcl 2>&1 | tee $(LOGFILE)

vivado_synth:
vivado -mode tcl -nolog -nojournal -source ./build_top.tcl -tclargs synth 2>&1 | tee $(LOGFILE)

vivado_prw:
vivado -mode tcl -nolog -nojournal -source ./build_top.tcl -tclargs prw 2>&1 | tee $(LOGFILE)

clean:
rm -rf $(BUILDDIR) $(OUTPUTDIR) $(VLOGDIR) .Xil *.jou *.log

.PHONY: verilog vivado
.DEFAULT_GOAL := verilog
228 changes: 228 additions & 0 deletions backend/batch_insert_ila.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
######################################################################
# Automatically inserts ILA instances in a batch flow, and calls "implement_debug_core". Can also be used in a GUI flow
# This should ONLY be invoked after synthesis, and before opt_design. If opt_design is called first, marked nets may be missing and not found
# Warning: Currently will skip a net if it has no obvious clock domain on the driver. Nets connected to input buffers will be dropped unless "mark_debug_clock" is attached to the net.
# Nets attached to VIO cores have the "mark_debug" attribute, and will be filtered out unless the "mark_debug_valid" attribute is attached.
# Supports the following additional attributes beyond "mark_debug"
# attribute mark_debug_valid of X : signal is "true"; -- Marks a net for ILA capture, even if net is also attached to a VIO core
# attribute mark_debug_clock of X : signal is "inst1_bufg/clock"; -- Specifies clock net to use for capturing this net. May create a new ILA core for that clock domain
# attribute mark_debug_depth of X : signal is "4096"; -- overrides default depth for this ILA core. valid values: 1024, 2048, ... 132072. Last attribute that is scanned will win.
# attribute mark_debug_adv_trigger of X : signal is "true"; -- specifies that advanced trigger capability will be added to ILA core
# Engineer: J. McCluskey

# Script version:
# https://forums.xilinx.com/xlnx/attachments/xlnx/Vivado/4090/1/new_batch_insert_ila.zip

proc batch_insert_ila { depth } {
##################################################################
# sequence through debug nets and organize them by clock in the
# clock_list array. Also create max and min array for bus indices
set dbgs [get_nets -hierarchical -filter {MARK_DEBUG}]
if {[llength $dbgs] == 0} {
puts "No nets have the MARK_DEBUG attribute. No ILA cores created"
return
} else {
#process list of nets to find and reject nets that are attached to VIO cores. This has a side effect that VIO nets can't be monitored with an ILA
# This can be overridden by using the attribute "mark_debug_valid" = "true" on a net like this.
set net_list {}
foreach net $dbgs {
if { [get_property -quiet MARK_DEBUG_VALID $net] != "true" } {
set pin_list [get_pins -of_objects [get_nets -segments $net]]
set not_vio_net 1
foreach pin $pin_list {
if { [get_property IS_DEBUG_CORE [get_cells -of_object $pin]] == 1 } {
# It seems this net is attached to a debug core (i.e. VIO core) already, so we should skip adding it to the netlist
set not_vio_net 0
break
}
}
if { $not_vio_net == 1 } { lappend net_list $net; }
} else {
lappend net_list $net
}
}
}
# check again to see if we have any nets left now
if {[llength $net_list] == 0} {
puts "All nets with MARK_DEBUG are already connected to VIO cores. No ILA cores created"
return
}
# Now that the netlist has been filtered, determine bus names and clock domains
foreach d $net_list {
# name is root name of a bus, index is the bit index in the
# bus
set name [regsub {\[[[:digit:]]+\]$} $d {}]
set index [regsub {^.*\[([[:digit:]]+)\]$} $d {\1}]
if {[string is integer -strict $index]} {
if {![info exists max($name)]} {
set max($name) $index
set min($name) $index
} elseif {$index > $max($name)} {
set max($name) $index
} elseif {$index < $min($name)} {
set min($name) $index
}
} else {
set max($name) -1
}
# Now we search for the local clock net associated with the target net. There may be ambiguities or no answer in some cases
if {![info exists clocks($name)]} {
# does MARK_DEBUG_CLOCK decorate this net? If not, then search backwards to the driver cell
set clk_name [get_property -quiet MARK_DEBUG_CLOCK $d]
if { [llength $clk_name] == 0 } {
# trace to the clock net, tracing backwards via the driver pin.
set driver_pin [get_pins -filter {DIRECTION == "OUT" && IS_LEAF == TRUE } -of_objects [ get_nets -segments $d ]]
set driver_cell [get_cells -of_objects $driver_pin]
if { [get_property IS_SEQUENTIAL $driver_cell] == 1 } {
set timing_arc [get_timing_arcs -to $driver_pin]
set cell_clock_pin [get_pins -filter {IS_CLOCK} [get_property FROM_PIN $timing_arc]]
if { [llength $cell_clock_pin] > 1 } {
puts "Error: in batch_insert_ila. Found more than 1 clock pin in driver cell $driver_cell with timing arc $timing_arc for net $d"
continue
}
} else {
# our driver cell is a LUT or LUTMEM in combinatorial mode, we need to trace further.
set paths [get_timing_paths -quiet -through $driver_pin ]
if { [llength $paths] > 0 } {
# note that here we arbitrarily select the start point of the FIRST timing path... there might be multiple clocks with timing paths for this net.
# use MARK_DEBUG_CLOCK to specify another clock in this case.
set cell_clock_pin [get_pins [get_property STARTPOINT_PIN [lindex $paths 0]]]
} else {
# Can't find any timing path, so skip the net, and warn the user.
puts "Critical Warning: from batch_insert_ila.tcl Can't trace any clock domain on driver of net $d"
puts "Please attach the attribute MARK_DEBUG_CLOCK with a string containing the net name of the desired sampling clock, .i.e."
puts "attribute mark_debug_clock of $d : signal is \"inst_bufg/clk\";"
continue
}
}
# clk_net will usually be a list of net segments, which needs filtering to determine the net connected to the driver pin
set clk_net [get_nets -segments -of_objects $cell_clock_pin]
} else {
set clk_net [get_nets -segments $clk_name]
if { [llength $clk_net] == 0 } { puts "MARK_DEBUG_CLOCK attribute on net $d does not match any known net. Please fix."; continue; }
}
# trace forward to net actually connected to clock buffer output, not any of the lower level segment names
set clocks($name) [get_nets -of_objects [get_pins -filter {DIRECTION == "OUT" && IS_LEAF == TRUE } -of_objects $clk_net]]
if {![info exists clock_list($clocks($name))]} {
# found a new clock
puts "New clock found is $clocks($name)"
set clock_list($clocks($name)) [list $name]
set ila_depth($clocks($name)) $depth
set ila_adv_trigger($clocks($name)) false
} else {
lappend clock_list($clocks($name)) $name
}
# Does this net have a "MARK_DEBUG_DEPTH" attribute attached?
set clk_depth [get_property -quiet MARK_DEBUG_DEPTH $d]
if { [llength $clk_depth] != 0 } {
set ila_depth($clocks($name)) $clk_depth
}
# Does this net have a "MARK_DEBUG_ADV_TRIGGER" attribute attached?
set trigger [get_property -quiet MARK_DEBUG_ADV_TRIGGER $d]
if { $trigger == "true" } {
set ila_adv_trigger($clocks($name)) true
}
}
}
set ila_count 0
set trig_out ""
set trig_out_ack ""
if { [llength [array names clock_list]] > 1 } {
set enable_trigger true
} else {
set enable_trigger false
}
foreach c [array names clock_list] {
# Now build and connect an ILA core for each clock domain
[incr ila_count ]
set ila_inst "ila_$ila_count"
##################################################################
# first verify if depth is a member of the set, 1024, 2048, 4096, 8192, ... 131072
if { $ila_depth($c) < 1024 || [expr $ila_depth($c) & ($ila_depth($c) - 1)] || $ila_depth($c) > 131072 } {
# Depth is not right... lets fix it, and continue
if { $ila_depth($c) < 1024 } {
set new_depth 1024
} elseif { $ila_depth($c) > 131072 } {
set new_depth 131072
} else {
# round value to next highest power of 2, (in log space)
set new_depth [expr 1 << int( log($ila_depth($c))/log(2) + .9999 )]
}
puts "Can't create ILA core $ila_inst with depth of $ila_depth($c)! Changed capture depth to $new_depth"
set ila_depth($c) $new_depth
}
# create ILA and connect its clock
puts "Creating ILA $ila_inst with capture depth $ila_depth($c) and advanced trigger = $ila_adv_trigger($c)"
if { [expr [string range [version -short] 0 3] < 2014] } {
create_debug_core $ila_inst labtools_ila_v3
} else {
create_debug_core $ila_inst ila
}
if { $ila_adv_trigger($c) } { set mu_cnt 4; } else { set mu_cnt 2; }
set_property C_DATA_DEPTH $ila_depth($c) [get_debug_cores $ila_inst]
set_property C_TRIGIN_EN $enable_trigger [get_debug_cores $ila_inst]
set_property C_TRIGOUT_EN $enable_trigger [get_debug_cores $ila_inst]
set_property C_ADV_TRIGGER $ila_adv_trigger($c) [get_debug_cores $ila_inst]
set_property C_INPUT_PIPE_STAGES 1 [get_debug_cores $ila_inst]
set_property C_EN_STRG_QUAL true [get_debug_cores $ila_inst]
set_property ALL_PROBE_SAME_MU true [get_debug_cores $ila_inst]
set_property ALL_PROBE_SAME_MU_CNT $mu_cnt [get_debug_cores $ila_inst]
set_property port_width 1 [get_debug_ports $ila_inst/clk]
connect_debug_port $ila_inst/clk $c
# hookup trigger ports in a circle if more than one ILA is created
if { $enable_trigger == true } {
create_debug_port $ila_inst trig_in
create_debug_port $ila_inst trig_in_ack
create_debug_port $ila_inst trig_out
create_debug_port $ila_inst trig_out_ack
if { $trig_out != "" } {
connect_debug_port $ila_inst/trig_in [get_nets $trig_out]
}
if { $trig_out_ack != "" } {
connect_debug_port $ila_inst/trig_in_ack [get_nets $trig_out_ack]
}
set trig_out ${ila_inst}_trig_out_$ila_count
create_net $trig_out
connect_debug_port $ila_inst/trig_out [get_nets $trig_out]
set trig_out_ack ${ila_inst}_trig_out_ack_$ila_count
create_net $trig_out_ack
connect_debug_port $ila_inst/trig_out_ack [get_nets $trig_out_ack]
}
##################################################################
# add probes
set nprobes 0
foreach n [lsort $clock_list($c)] {
set nets {}
if {$max($n) < 0} {
lappend nets [get_nets $n]
} else {
# n is a bus name
for {set i $min($n)} {$i <= $max($n)} {incr i} {
lappend nets [get_nets $n[$i]]
}
}
set prb probe$nprobes
if {$nprobes > 0} {
create_debug_port $ila_inst probe
}
set_property port_width [llength $nets] [get_debug_ports $ila_inst/$prb]
connect_debug_port $ila_inst/$prb $nets
incr nprobes
}
}
# at this point, we need to complete the circular connection of trigger outputs and acks
if { $enable_trigger == true } {
connect_debug_port ila_1/trig_in [get_nets $trig_out]
connect_debug_port ila_1/trig_in_ack [get_nets $trig_out_ack]
}
set project_found [get_projects -quiet]
if { $project_found != "New Project" } {
puts "Saving constraints now in project [current_project -quiet]"
save_constraints_as debug_constraints.xdc
}
##################################################################
implement_debug_core
##################################################################
# write out probe info file
write_debug_probes -force debug_nets.ltx
}
Loading