Skip to content

Commit

Permalink
Merge pull request #150 from zeroasiccorp/update-sc
Browse files Browse the repository at this point in the history
update to new SC
  • Loading branch information
gadfort authored Jul 30, 2024
2 parents e6ff99c + befbb27 commit 0b82c53
Show file tree
Hide file tree
Showing 22 changed files with 72 additions and 90 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ urls = {Homepage = "https://github.com/zeroasiccorp/umi"}
requires-python = ">= 3.8"
license = {file = "LICENSE"}
dependencies = [
"siliconcompiler>=0.24.0",
"lambdalib>=0.2.4, <0.2.7"
"siliconcompiler>=0.26.0",
"lambdalib>=0.2.9, <0.2.10"
]
dynamic = [
"version"
Expand All @@ -29,7 +29,7 @@ version = {attr = "umi.__version__"}

[project.optional-dependencies]
test = [
"switchboard-hw",
"switchboard-hw>=0.2.14",
"flake8==7.1.0"
]

Expand Down
27 changes: 5 additions & 22 deletions umi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
from siliconcompiler import Library
import lambdalib
from umi import umi, lumi


__version__ = "0.1.1"


def _register_umi(lib):
lib.register_source("umi", "python://umi")


def setup(chip):
libs = []

for name in ('umi', 'lumi'):
lib = Library(chip, name, package="umi")
_register_umi(lib)
lib.use(lambdalib)

lib.add("option", "idir", f"{name}/rtl")
lib.add("option", "ydir", f"{name}/rtl")

lib.add("option", "idir", "utils/rtl")
lib.add("option", "ydir", "utils/rtl")

libs.append(lib)

return libs
return [
umi.setup(chip),
lumi.setup(chip)
]
21 changes: 21 additions & 0 deletions umi/lumi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from siliconcompiler import Library
from umi import umi
from lambdalib import auxlib, ramlib


def setup(chip):
lib = Library(chip, "lumi", package="umi", auto_enable=True)
lib.register_source("umi", "python://umi")

lib.add("option", "idir", "lumi/rtl")
lib.add("option", "ydir", "lumi/rtl")

lib.add("option", "idir", "utils/rtl")
lib.add("option", "ydir", "utils/rtl")

lib.use(umi)

lib.use(auxlib)
lib.use(ramlib)

return lib
10 changes: 5 additions & 5 deletions umi/lumi/rtl/lumi_rx.v
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ module lumi_rx
.CHAOS(0), // generates random full logic when set
.CTRLW(1), // width of asic ctrl interface
.TESTW(1), // width of asic test interface
.TYPE("DEFAULT")) // Pass through variable for hard macro
.PROP("DEFAULT")) // Pass through variable for hard macro
req_fifo_i(// Outputs
.wr_full (req_fifo_full[j]),
.rd_dout (req_fifo_dout[j*RXFIFOW+:RXFIFOW]),
Expand Down Expand Up @@ -598,7 +598,7 @@ module lumi_rx
.CHAOS(0), // generates random full logic when set
.CTRLW(1), // width of asic ctrl interface
.TESTW(1), // width of asic test interface
.TYPE("DEFAULT")) // Pass through variable for hard macro
.PROP("DEFAULT")) // Pass through variable for hard macro
resp_fifo_i(// Outputs
.wr_full (resp_fifo_full[k]),
.rd_dout (resp_fifo_dout[k*RXFIFOW+:RXFIFOW]),
Expand Down Expand Up @@ -663,7 +663,7 @@ module lumi_rx
.CHAOS(0), // generates random full logic when set
.CTRLW(1), // width of asic ctrl interface
.TESTW(1), // width of asic test interface
.TYPE("DEFAULT")) // Pass through variable for hard macro
.PROP("DEFAULT")) // Pass through variable for hard macro
lnk_fifo_i(// Outputs
.wr_full (),
.rd_dout (lnk_fifo_dout[CW-1:0]),
Expand Down Expand Up @@ -782,7 +782,7 @@ module lumi_rx
.CHAOS(0), // generates random full logic when set
.CTRLW(1), // width of asic ctrl interface
.TESTW(1), // width of asic test interface
.TYPE("DEFAULT")) // Pass through variable for hard macro
.PROP("DEFAULT")) // Pass through variable for hard macro
req_syncfifo_i(// Outputs
.wr_full (sync_fifo_full[0]),
.rd_dout (sync_fifo_dout[IOW-1:0]),
Expand Down Expand Up @@ -810,7 +810,7 @@ module lumi_rx
.CHAOS(0), // generates random full logic when set
.CTRLW(1), // width of asic ctrl interface
.TESTW(1), // width of asic test interface
.TYPE("DEFAULT")) // Pass through variable for hard macro
.PROP("DEFAULT")) // Pass through variable for hard macro
resp_syncfifo_i(// Outputs
.wr_full (sync_fifo_full[1]),
.rd_dout (sync_fifo_dout[2*IOW-1:IOW]),
Expand Down
2 changes: 1 addition & 1 deletion umi/lumi/rtl/lumi_tx.v
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ module lumi_tx
.CHAOS(0), // generates random full logic when set
.CTRLW(1), // width of asic ctrl interface
.TESTW(1), // width of asic test interface
.TYPE("DEFAULT")) // Pass through variable for hard macro
.PROP("DEFAULT")) // Pass through variable for hard macro
phy_fifo_i(// Outputs
.wr_full (phy_fifo_full),
.rd_dout (phy_txdata[IOW-1:0]),
Expand Down
8 changes: 2 additions & 6 deletions umi/lumi/testbench/test_lumi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy as np
from argparse import ArgumentParser
from switchboard import SbDut, UmiTxRx, delete_queue
import umi
from umi import lumi


def build_testbench(topo="2d", trace=False):
Expand All @@ -24,11 +24,7 @@ def build_testbench(topo="2d", trace=False):
else:
raise ValueError('Invalid topology')

dut.use(umi)
dut.add('option', 'library', ['lumi', 'umi'])
dut.add('option', 'library', 'lambdalib_auxlib')
dut.add('option', 'library', 'lambdalib_ramlib')
dut.add('option', 'library', 'lambdalib_vectorlib')
dut.use(lumi)

# Verilator configuration
dut.set('tool', 'verilator', 'task', 'compile', 'file', 'config', 'lumi/testbench/config.vlt', package='umi')
Expand Down
8 changes: 2 additions & 6 deletions umi/lumi/testbench/test_lumi_rnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy as np
from argparse import ArgumentParser
from switchboard import SbDut, UmiTxRx, delete_queue
import umi
from umi import lumi


def build_testbench(topo="2d", trace=False):
Expand All @@ -24,11 +24,7 @@ def build_testbench(topo="2d", trace=False):
else:
raise ValueError('Invalid topology')

dut.use(umi)
dut.add('option', 'library', ['lumi', 'umi'])
dut.add('option', 'library', 'lambdalib_auxlib')
dut.add('option', 'library', 'lambdalib_ramlib')
dut.add('option', 'library', 'lambdalib_vectorlib')
dut.use(lumi)

# Verilator configuration
dut.set('tool', 'verilator', 'task', 'compile', 'file', 'config', 'lumi/testbench/config.vlt', package='umi')
Expand Down
19 changes: 19 additions & 0 deletions umi/umi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from siliconcompiler import Library
from lambdalib import auxlib, ramlib, vectorlib


def setup(chip):
lib = Library(chip, "umi", package="umi", auto_enable=True)
lib.register_source("umi", "python://umi")

lib.add("option", "idir", "umi/rtl")
lib.add("option", "ydir", "umi/rtl")

lib.add("option", "idir", "utils/rtl")
lib.add("option", "ydir", "utils/rtl")

lib.use(auxlib)
lib.use(ramlib)
lib.use(vectorlib)

return lib
2 changes: 1 addition & 1 deletion umi/umi/rtl/umi_mem_agent.v
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ module umi_mem_agent

la_spram #(.DW (DW), // Memory width
.AW ($clog2(RAMDEPTH)), // Address width (derived)
.TYPE (SRAMTYPE), // Pass through variable for hard macro
.PROP (SRAMTYPE), // Pass through variable for hard macro
.CTRLW (CTRLW), // Width of asic ctrl interface
.TESTW (128) // Width of asic test interface
)
Expand Down
6 changes: 1 addition & 5 deletions umi/umi/testbench/test_crossbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np
from argparse import ArgumentParser
from switchboard import UmiTxRx, random_umi_packet, delete_queue, verilator_run, SbDut
import umi
from umi import umi


def build_testbench():
Expand All @@ -18,10 +18,6 @@ def build_testbench():
dut.input('umi/testbench/testbench_crossbar.sv', package='umi')

dut.use(umi)
dut.add('option', 'library', 'umi')
dut.add('option', 'library', 'lambdalib_auxlib')
dut.add('option', 'library', 'lambdalib_ramlib')
dut.add('option', 'library', 'lambdalib_vectorlib')

# Verilator configuration
dut.set('tool', 'verilator', 'task', 'compile', 'file', 'config', 'umi/testbench/config.vlt', package='umi')
Expand Down
5 changes: 1 addition & 4 deletions umi/umi/testbench/test_fifo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
from argparse import ArgumentParser
from switchboard import SbDut, UmiTxRx, delete_queue, verilator_run
import umi
from umi import umi


def build_testbench():
Expand All @@ -17,9 +17,6 @@ def build_testbench():
dut.input('umi/testbench/testbench_fifo.sv', package='umi')

dut.use(umi)
dut.add('option', 'library', 'umi')
dut.add('option', 'library', 'lambdalib_auxlib')
dut.add('option', 'library', 'lambdalib_ramlib')

# Verilator configuration
dut.set('tool', 'verilator', 'task', 'compile', 'file', 'config', 'umi/testbench/config.vlt', package='umi')
Expand Down
5 changes: 1 addition & 4 deletions umi/umi/testbench/test_fifo_flex.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
from argparse import ArgumentParser
from switchboard import SbDut, UmiTxRx, delete_queue, verilator_run
import umi
from umi import umi


def build_testbench(split=False):
Expand All @@ -17,9 +17,6 @@ def build_testbench(split=False):
dut.input('umi/testbench/testbench_fifo_flex.sv', package='umi')

dut.use(umi)
dut.add('option', 'library', 'umi')
dut.add('option', 'library', 'lambdalib_auxlib')
dut.add('option', 'library', 'lambdalib_ramlib')

dut.add('option', 'define', f'SPLIT={int(split)}')

Expand Down
5 changes: 1 addition & 4 deletions umi/umi/testbench/test_mem_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
from argparse import ArgumentParser
from switchboard import SbDut, UmiTxRx, delete_queue, verilator_run
import umi
from umi import umi


def build_testbench():
Expand All @@ -16,9 +16,6 @@ def build_testbench():
dut.input('umi/testbench/testbench_mem_agent.sv', package='umi')

dut.use(umi)
dut.add('option', 'library', 'umi')
dut.add('option', 'library', 'lambdalib_auxlib')
dut.add('option', 'library', 'lambdalib_ramlib')

# Verilator configuration
dut.set('tool', 'verilator', 'task', 'compile', 'file', 'config', 'umi/testbench/config.vlt', package='umi')
Expand Down
4 changes: 1 addition & 3 deletions umi/umi/testbench/test_regif.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
from argparse import ArgumentParser
from switchboard import SbDut, UmiTxRx, delete_queue, verilator_run
import umi
from umi import umi


def build_testbench():
Expand All @@ -17,8 +17,6 @@ def build_testbench():
dut.input('umi/testbench/testbench_regif.sv', package='umi')

dut.use(umi)
dut.add('option', 'library', 'umi')
dut.add('option', 'library', 'lambdalib_ramlib')

# Verilator configuration
dut.set('tool', 'verilator', 'task', 'compile', 'file', 'config', 'umi/testbench/config.vlt', package='umi')
Expand Down
6 changes: 1 addition & 5 deletions umi/umi/testbench/test_umi_ram.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
from argparse import ArgumentParser
from switchboard import SbDut, UmiTxRx, verilator_run
import umi
from umi import umi


def build_testbench():
Expand All @@ -16,10 +16,6 @@ def build_testbench():
dut.input('umi/testbench/testbench_umi_ram.sv', package='umi')

dut.use(umi)
dut.add('option', 'library', 'umi')
dut.add('option', 'library', 'lambdalib_auxlib')
dut.add('option', 'library', 'lambdalib_ramlib')
dut.add('option', 'library', 'lambdalib_vectorlib')

# Verilator configuration
dut.set('tool', 'verilator', 'task', 'compile', 'file', 'config', 'umi/testbench/config.vlt', package='umi')
Expand Down
2 changes: 1 addition & 1 deletion umi/utils/rtl/tl2umi_np.v
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ module tl2umi_np #(
la_syncfifo #(
.DW (CW + AW + AW + DW),
.DEPTH (2),
.TYPE ("DEFAULT")
.PROP ("DEFAULT")
) tl2umi_req_fifo (
.clk (clk),
.nreset (nreset),
Expand Down
7 changes: 1 addition & 6 deletions umi/utils/testbench/test_tl2umi_np.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from siliconcompiler import Chip
from siliconcompiler.flows import dvflow
from siliconcompiler.package import path as sc_path
import umi
from umi import umi


def build():
Expand All @@ -15,11 +15,6 @@ def build():

chip.input('utils/testbench/tb_tl2umi_np.v', package='umi')

chip.add('option', 'library', 'umi')
chip.add('option', 'library', 'lambdalib_auxlib')
chip.add('option', 'library', 'lambdalib_ramlib')
chip.add('option', 'library', 'lambdalib_vectorlib')

memfile = f"{sc_path(chip, 'umi')}/utils/testbench/buffer.memh"

chip.add('tool', 'execute', 'task', 'exec_input', 'option', f'+MEMHFILE={memfile}')
Expand Down
4 changes: 1 addition & 3 deletions umi/utils/testbench/test_umi2apb.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
import random
import numpy as np
from switchboard import SbDut, UmiTxRx, verilator_run
import umi
from umi import umi


def build_testbench(dut):
# Set up inputs
dut.input('utils/testbench/testbench_umi2apb.sv', package='umi')

dut.use(umi)
dut.add('option', 'library', 'umi')
dut.add('option', 'library', 'lambdalib_ramlib')

# Verilator configuration
dut.set('tool', 'verilator', 'task', 'compile', 'file', 'config', 'utils/testbench/config.vlt',
Expand Down
6 changes: 1 addition & 5 deletions umi/utils/testbench/test_umi2axilite.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
from argparse import ArgumentParser
from switchboard import SbDut, UmiTxRx, delete_queue, verilator_run
import umi
from umi import umi


def build_testbench():
Expand All @@ -17,10 +17,6 @@ def build_testbench():
dut.input('utils/testbench/testbench_umi2axilite.sv', package='umi')

dut.use(umi)
dut.add('option', 'library', 'umi')
dut.add('option', 'library', 'lambdalib_ramlib')
dut.add('option', 'library', 'lambdalib_auxlib')
dut.add('option', 'library', 'lambdalib_vectorlib')

# Verilator configuration
dut.set('tool', 'verilator', 'task', 'compile', 'file', 'config',
Expand Down
Loading

0 comments on commit 0b82c53

Please sign in to comment.