Initial pythonized version running
This commit is contained in:
parent
c199db7bfd
commit
81ffde3c12
6
.project
6
.project
|
@ -5,6 +5,11 @@
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.python.pydev.PyDevBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||||
<triggers>clean,full,incremental,</triggers>
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
@ -24,5 +29,6 @@
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||||
<nature>org.eclipse.linuxtools.tmf.project.nature</nature>
|
<nature>org.eclipse.linuxtools.tmf.project.nature</nature>
|
||||||
|
<nature>org.python.pydev.pythonNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?eclipse-pydev version="1.0"?><pydev_project>
|
||||||
|
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
|
||||||
|
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python interpreter</pydev_property>
|
||||||
|
</pydev_project>
|
|
@ -0,0 +1,48 @@
|
||||||
|
import os.path
|
||||||
|
import logging
|
||||||
|
import cppyy
|
||||||
|
from cppyy import gbl as cpp
|
||||||
|
from array import array
|
||||||
|
import pysysc
|
||||||
|
from pysysc.structural import Connection, Module, Signal, Simulation
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# setup and load
|
||||||
|
###############################################################################
|
||||||
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
build_type='Debug'
|
||||||
|
###############################################################################
|
||||||
|
myDir = os.path.dirname( os.path.realpath(__file__))
|
||||||
|
pysysc.read_config_from_conan(os.path.join(myDir, 'conanfile.txt'), build_type)
|
||||||
|
pysysc.load_systemc()
|
||||||
|
###############################################################################
|
||||||
|
logging.debug("Loading Components lib")
|
||||||
|
pysysc.add_include_path(os.path.join(myDir, 'scc/incl'))
|
||||||
|
pysysc.add_include_path(os.path.join(myDir, 'dbt-core/incl'))
|
||||||
|
pysysc.add_include_path(os.path.join(myDir, 'riscv/incl'))
|
||||||
|
pysysc.add_include_path(os.path.join(myDir, 'platform/incl'))
|
||||||
|
pysysc.add_library('sysc/top/system.h', os.path.join(myDir, 'build/%s/lib/libplatform.so'%build_type))
|
||||||
|
cppyy.include("iss/llvm/jit_helper.h")
|
||||||
|
cppyy.include("scc/configurer.h")
|
||||||
|
cppyy.include("sysc/top/system.h")
|
||||||
|
###############################################################################
|
||||||
|
# configure
|
||||||
|
###############################################################################
|
||||||
|
Simulation.setup(logging.root.level)
|
||||||
|
cpp.iss.init_jit();
|
||||||
|
cfg=cpp.scc.configurer("system.json");
|
||||||
|
###############################################################################
|
||||||
|
# instantiate
|
||||||
|
###############################################################################
|
||||||
|
dut = Module(cpp.sysc.system).create("i_system")
|
||||||
|
cfg.set_value("i_system.i_hifive1.i_fe310.i_core_complex.elf_file", "../RISCV-Tests/hello/hello");
|
||||||
|
of=cpp.std.ofstream("hier.txt")
|
||||||
|
cfg.dump_configuration(of);
|
||||||
|
of.close()
|
||||||
|
###############################################################################
|
||||||
|
# run if it is standalone
|
||||||
|
###############################################################################
|
||||||
|
if __name__ == "__main__":
|
||||||
|
Simulation.configure(enable_vcd=False)
|
||||||
|
Simulation.run()
|
||||||
|
logging.debug("Done")
|
Loading…
Reference in New Issue