-
Notifications
You must be signed in to change notification settings - Fork 8
/
zerosoc_core.py
41 lines (31 loc) · 1.2 KB
/
zerosoc_core.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
from siliconcompiler import Library
from siliconcompiler.package import path as sc_path
import opentitan
from lambdalib import ramlib
def setup():
lib = Library("zerosoc_core", package='zerosoc', auto_enable=True)
lib.register_source(
name='zerosoc',
path=os.path.abspath(os.path.dirname(__file__)))
lib.add('option', 'idir', 'hw')
lib.add('option', 'ydir', 'hw/prim')
# lib.input('hw/asic_top.v')
lib.input('hw/xbar_pkg.sv')
lib.input('hw/prim/prim_pkg.sv')
lib.input('hw/uart_core.sv')
lib.input('hw/zerosoc.sv')
lib.input('hw/xbar.sv')
lib.input('hw/tl_dbg.sv')
lib.input('hw/asic_core.v')
# TODO: break into separate lib
lib.input('hw/prim/lambdalib/prim_lambdalib_ram_1p.v')
lib.input('hw/prim/lambdalib/prim_lambdalib_clock_gating.v')
# hack to work around fact that $readmemh now runs in context of build
# directory and can't load .mem files using relative paths
lib.add('option', 'define', f'MEM_ROOT={sc_path(lib, "zerosoc")}')
lib.add('option', 'define', 'PRIM_DEFAULT_IMPL="prim_pkg::ImplLambdalib"')
lib.add('option', 'define', 'RAM_DEPTH=512')
lib.use(opentitan)
lib.use(ramlib)
return lib