Skip to content

Commit 55b655c

Browse files
committed
Build system fixes for dsim
1 parent 49bfc05 commit 55b655c

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

dv/uvm/core_ibex/scripts/run_instr_gen.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ def reloc_word(simulator: str,
6565
# For Xcelium, the build directory gets passed as the
6666
# "-xmlibdirpath" argument.
6767
(placeholder_dir, build_dir)
68+
],
69+
'dsim': [
70+
# DSim build path
71+
(os.path.join(placeholder_dir, 'dsim'),
72+
os.path.join(build_dir, 'dsim'))
6873
]
6974
}
7075
always_relocs = [

dv/uvm/core_ibex/yaml/rtl_simulation.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
130130
############################################################
131131
- tool: dsim
132-
env_var: DSIM,DSIM_LIB_PATH
132+
env_var: DSIM,DSIM_LIB_PATH,IBEX_ROOT
133133
compile:
134134
cmd:
135135
- >-
@@ -142,11 +142,21 @@
142142
$UVM_HOME/src/uvm_pkg.sv
143143
+define+UVM
144144
+define+DSIM
145+
+define+UVM_REGEX_NO_DPI
145146
+acc+rwb
146147
-f <core_ibex>/ibex_dv_defines.f
147148
-f <core_ibex>/ibex_dv.f
148149
-l <tb_build_log>
149-
-suppress EnumMustBePositive"
150+
-suppress EnumMustBePositive
151+
<cmp_opts>
152+
<cosim_opts>
153+
# dsim does not link image.so with ISS_LDFLAGS and ISS_LIBS, so symbols are missing
154+
# so we need to re-link image.so with the linker flags and libraries
155+
- gcc -shared -Bsymbolic -o <tb_dir>/image.so @<tb_dir>/obj/objfiles <ISS_LDFLAGS> <ISS_LIBS> -lstdc++
156+
cosim_opts: >-
157+
-f <core_ibex>/ibex_dv_cosim_dpi.f
158+
-ld-opts '<ISS_LDFLAGS> <ISS_LIBS> -lstdc++'
159+
-c-opts '<ISS_CFLAGS> <ISS_LIBS> -lstdc++ -I<IBEX_ROOT>/dv/cosim'
150160
sim:
151161
cmd:
152162
- >-

util/ibex_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ def main():
271271
lambda p, v: [],
272272
lambda d, v: ['+define+' + d + '=' + v], '/'),
273273
SimOpts('xlm_opts', 'Xcelium compile',
274-
lambda p, v: ['-defparam', p + '=' + v],
274+
lambda p, v: ['-defparam', p + '=' + v],
275275
lambda d, v: ['-define', d + '=' + v], '.'),
276-
SimOpts('dsim_compile_opts', 'DSim compile',
277-
lambda p, v: ['+define+' + p + '=' + v],
278-
lambda d, v: [], '/'),
276+
SimOpts('dsim_opts', 'DSim compile',
277+
lambda p, v: ['-defparam', p + '=' + v],
278+
lambda d, v: ['+define+' + d + '=' + v], '.'),
279279
]
280280

281281
argparser = argparse.ArgumentParser(description=(

0 commit comments

Comments
 (0)