Skip to content

Commit 3fb5f46

Browse files
committed
WIP: removed modification of design object from within SbDut
1 parent f78ec8a commit 3fb5f46

File tree

3 files changed

+57
-7
lines changed

3 files changed

+57
-7
lines changed

python/switchboard_pybind.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,8 @@ class PyUmi {
639639
}
640640

641641
py::array read(uint64_t addr, uint32_t num, size_t bytes_per_elem, uint64_t srcaddr = 0,
642-
uint32_t qos = 0, uint32_t prot = 0, bool error = true) {
642+
uint32_t max_bytes = UMI_PACKET_DATA_BYTES, uint32_t qos = 0, uint32_t prot = 0,
643+
bool error = true) {
643644

644645
// read "num" bytes from the given address. "num" may be any value,
645646
// including greater than the length of a header packet, and values

switchboard/sbdesign.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
from siliconcompiler import Design
2+
from typing import List, Tuple
3+
4+
5+
class SbDesign(Design):
6+
def __init__(
7+
self,
8+
name: str = "SbDesign",
9+
trace: bool = False,
10+
topmodule: str = None,
11+
dep: List[Design] = None,
12+
files: List[str] = None,
13+
idir: List[str] = None,
14+
define: List[str] = None,
15+
undefine: List[str] = None,
16+
param: List[Tuple] = None
17+
):
18+
19+
super().__init__(name)
20+
21+
# Taking care of Nones
22+
if idir is None:
23+
idir = []
24+
if dep is None:
25+
dep = []
26+
if define is None:
27+
define = []
28+
if undefine is None:
29+
undefine = []
30+
if param is None:
31+
param = []
32+
33+
# Setting RTL list, others outside
34+
with self.active_fileset('rtl'):
35+
if topmodule:
36+
self.set_topmodule(topmodule)
37+
for item in files:
38+
self.add_file(item)
39+
for item in idir:
40+
self.add_idir(item)
41+
for item in dep:
42+
self.add_depfileset(item)
43+
for item in define:
44+
self.add_define(item)
45+
for item in undefine:
46+
self.add_undefine(item)
47+
for item in param:
48+
self.add_param(item[0], item[1])
49+
50+
with self.active_fileset('icarus'):
51+
if topmodule:
52+
self.set_topmodule(topmodule)
53+
self.add_depfileset(self, 'rtl')
54+
if trace:
55+
self.add_define("SB_TRACE")

switchboard/sbdut.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,6 @@ def __init__(
246246
elif self.tool == 'verilator':
247247
self._configure_verilator()
248248

249-
if trace:
250-
self.design.add_define("SB_TRACE")
251-
252-
if self.trace_type == 'fst':
253-
self.design.add_define("SB_TRACE_FST")
254-
255249
else:
256250
from switchboard.sc.standalone_netlist_flow import StandaloneNetlistFlow
257251
self.set_flow(StandaloneNetlistFlow())

0 commit comments

Comments
 (0)