mirror of
https://github.com/olofk/serv.git
synced 2025-06-28 01:03:50 -04:00
Clean up RISCOF support structure
The RISCOF regression test suite can now be run from a workspace instead of having to be run from inside the repo. Also removes the need for a submodule.
This commit is contained in:
parent
cd3b587364
commit
c6e5053c78
9 changed files with 109 additions and 136 deletions
54
.github/workflows/ci.yml
vendored
54
.github/workflows/ci.yml
vendored
|
@ -1,11 +1,11 @@
|
||||||
name: CI
|
name: Run compliance test suite
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compliance:
|
compliance:
|
||||||
name: RISC-V Compliance Test
|
name: RISC-V Compliance Test
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -14,51 +14,39 @@ jobs:
|
||||||
|
|
||||||
- name: install fusesoc, verilator, gcc and riscof
|
- name: install fusesoc, verilator, gcc and riscof
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y python3-setuptools verilator gcc-riscv64-unknown-elf
|
sudo apt-get install -y python3-setuptools verilator
|
||||||
pip3 install fusesoc
|
pip3 install fusesoc
|
||||||
pip3 install git+https://github.com/riscv/riscof.git
|
pip3 install riscof
|
||||||
|
wget -qO- https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.07.05/riscv64-elf-ubuntu-22.04-gcc-nightly-2023.07.05-nightly.tar.gz | tar xz
|
||||||
|
echo $GITHUB_WORKSPACE/riscv/bin >> $GITHUB_PATH
|
||||||
|
|
||||||
|
|
||||||
- name: set root and SERV directory
|
- name: set root and SERV directory
|
||||||
run: |
|
run: |
|
||||||
echo "SERV=$GITHUB_WORKSPACE/serv" >> $GITHUB_ENV
|
echo "SERV=$GITHUB_WORKSPACE/serv" >> $GITHUB_ENV
|
||||||
echo "WORKSPACE=$GITHUB_WORKSPACE/" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: setup workspace
|
- name: setup workspace
|
||||||
run: fusesoc library add serv $SERV
|
run: fusesoc library add serv $SERV
|
||||||
|
|
||||||
- name: Update submodule to add arch-tests
|
|
||||||
run: |
|
|
||||||
cd $SERV
|
|
||||||
git submodule init
|
|
||||||
git submodule update
|
|
||||||
|
|
||||||
- name: Setup SAIL-RISCV Model
|
- name: Setup SAIL-RISCV Model
|
||||||
run: |
|
run: |
|
||||||
tar -xzf $SERV/verif/bin/sail-riscv.tar.gz
|
tar -xzf $SERV/verif/bin/sail-riscv.tar.gz
|
||||||
echo $GITHUB_WORKSPACE/sail-riscv >> $GITHUB_PATH
|
echo $GITHUB_WORKSPACE/sail-riscv >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Init arch tests
|
||||||
|
run: riscof arch-test --clone
|
||||||
|
|
||||||
- name: Run RV32I compliance tests
|
- name: Run RV32I compliance tests
|
||||||
run: |
|
run: riscof run --config=$SERV/verif/config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/I --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
||||||
cd $SERV/verif
|
|
||||||
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/I --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
|
||||||
|
|
||||||
- name: Run RV32IM compliance tests
|
- name: Run RV32IM compliance tests
|
||||||
run: |
|
run: riscof run --config=$SERV/verif/config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/M --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
||||||
cd $SERV/verif
|
|
||||||
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/M --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
|
||||||
|
|
||||||
- name: Run RV32IC compliance tests
|
- name: Run RV32IC compliance tests
|
||||||
run: |
|
run: riscof run --config=$SERV/verif/config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/C --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
||||||
cd $SERV/verif
|
|
||||||
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/C --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
|
||||||
|
|
||||||
- name: Run RV32I Zifencei compliance tests
|
- name: Run RV32I Zifencei compliance tests
|
||||||
run: |
|
run: riscof run --config=$SERV/verif/config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/Zifencei --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
||||||
cd $SERV/verif
|
|
||||||
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/Zifencei --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
|
||||||
|
|
||||||
- name: Run RV32I Privilege compliance tests
|
- name: Run RV32I Privilege compliance tests
|
||||||
run: |
|
run: riscof run --config=$SERV/verif/config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/privilege --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
||||||
cd $SERV/verif
|
|
||||||
riscof run --config=config.ini --suite=riscv-arch-test/riscv-test-suite/rv32i_m/privilege --env=riscv-arch-test/riscv-test-suite/env --no-browser
|
|
||||||
|
|
||||||
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,3 +0,0 @@
|
||||||
[submodule "verif/riscv-arch-test"]
|
|
||||||
path = verif/riscv-arch-test
|
|
||||||
url = https://github.com/riscv-non-isa/riscv-arch-test
|
|
2
verif/.gitignore
vendored
2
verif/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
*/__*
|
|
||||||
riscof_work
|
|
|
@ -9,59 +9,57 @@ In our case, DUT is SERV core and reference is the [sail-riscv](https://github.c
|
||||||
|
|
||||||
- [RISC-V GCC Toolchain](https://github.com/riscv-collab/riscv-gnu-toolchain) - Install toolchain by running following command.
|
- [RISC-V GCC Toolchain](https://github.com/riscv-collab/riscv-gnu-toolchain) - Install toolchain by running following command.
|
||||||
|
|
||||||
|
|
||||||
sudo apt-get install -y gcc-riscv64-unknown-elf
|
sudo apt-get install -y gcc-riscv64-unknown-elf
|
||||||
> :bulb: By default, RISCOF plugins uses [RV32](https://github.com/riscv-collab/riscv-gnu-toolchain#:~:text=To%20build%20the%2032%2Dbit%20RV32GC%20toolchain%2C%20use%3A) toolchain for compiling native `rv32` code. For SERV, this dependency has been removed from the plugin as RV64 is sufficient for 32-bit systems as well.
|
> :bulb: By default, RISCOF plugins uses [RV32](https://github.com/riscv-collab/riscv-gnu-toolchain#:~:text=To%20build%20the%2032%2Dbit%20RV32GC%20toolchain%2C%20use%3A) toolchain for compiling native `rv32` code. For SERV, this dependency has been removed from the plugin as RV64 is sufficient for 32-bit systems as well.
|
||||||
|
|
||||||
- [SAIL-RISCV](https://github.com/riscv/sail-riscv) - The reference model can be build by following [these](https://riscof.readthedocs.io/en/stable/installation.html#install-plugin-models) instructions. The pre-built binaries of sail-riscv is available in [`bin`](/verif/bin/) directory.
|
- [SAIL-RISCV](https://github.com/riscv/sail-riscv) - The reference model can be build by following [these](https://riscof.readthedocs.io/en/stable/installation.html#install-plugin-models) instructions. The pre-built binaries of sail-riscv is available in [`bin`](/verif/bin/) directory. Extract the tarball somewhere and add the directory containing `riscv_sim_RV32` to your PATH
|
||||||
|
|
||||||
- [riscv-arch-tests](https://github.com/riscv-non-isa/riscv-arch-test) - Compliance tests are added as a submodule in `$SERV/verif`. Run the following commands from the `$SERV`.
|
|
||||||
|
|
||||||
$ git submodule init
|
|
||||||
$ git submodule update
|
|
||||||
This will clone the arch-tests repository into the `$SERV/verif/riscv-arch-tests`.
|
|
||||||
- [RISCOF](https://riscof.readthedocs.io/en/stable/installation.html#install-python) - If you have installed [Python](https://riscof.readthedocs.io/en/stable/installation.html#install-python), run the folllowing command to [install RISCOF](https://riscof.readthedocs.io/en/stable/installation.html#).
|
- [RISCOF](https://riscof.readthedocs.io/en/stable/installation.html#install-python) - If you have installed [Python](https://riscof.readthedocs.io/en/stable/installation.html#install-python), run the folllowing command to [install RISCOF](https://riscof.readthedocs.io/en/stable/installation.html#).
|
||||||
|
|
||||||
pip3 install git+https://github.com/riscv/riscof.git
|
pip3 install riscof
|
||||||
|
|
||||||
> :warning: Make sure to export the root directory as `$WORKSPACE` and also make sure to have the directory structure that looks like this.
|
- [riscv-arch-tests](https://github.com/riscv-non-isa/riscv-arch-test) - Compliance tests are installed into the workspace by running:
|
||||||
|
|
||||||
|
$ riscof arch-test --clone
|
||||||
|
|
||||||
|
or alternatively
|
||||||
|
|
||||||
|
$ riscof arch-test --update
|
||||||
|
|
||||||
|
if the tests are already installed and just needs to be updated.
|
||||||
|
|
||||||
|
> Make sure to have the directory structure that looks like this.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.
|
.
|
||||||
$WORKSPACE
|
|
||||||
|
|
|
|
||||||
├── build
|
|
||||||
│ └── ...
|
|
||||||
├── fusesoc.conf
|
├── fusesoc.conf
|
||||||
└── fusesoc_libraries
|
├── fusesoc_libraries
|
||||||
├── fusesoc_cores
|
| ├── fusesoc_cores
|
||||||
│ └── ...
|
| │ └── ...
|
||||||
├── mdu
|
| ├── mdu
|
||||||
│ └── ...
|
| │ └── ...
|
||||||
└── serv
|
| └── serv
|
||||||
├── ...
|
| ├── ...
|
||||||
├── verif
|
| ├── verif
|
||||||
| ├── bin
|
| | ├── bin
|
||||||
| | └── ...
|
| | | └── ...
|
||||||
| ├── config.ini
|
| | ├── config.ini
|
||||||
| ├── plugin-sail_cSim
|
| | ├── plugin-sail_cSim
|
||||||
| | └── ...
|
| | | └── ...
|
||||||
| ├── plugin-serv
|
| | ├── plugin-serv
|
||||||
| | └── ...
|
| | | └── ...
|
||||||
| ├── Readme.md
|
| └── ...
|
||||||
| ├── riscv-arch-test
|
├── riscv-arch-test
|
||||||
| | └── ...
|
└── ...
|
||||||
| └── sim
|
|
||||||
| └── ...
|
|
||||||
└── ...
|
|
||||||
|
|
||||||
## Running Compliance tests
|
## Running Compliance tests
|
||||||
After completing all the steps in [Getting started](/README.md) followed by the [Prerequisites](##Prerequisites), we are all set to run the complaince tests.
|
After completing all the steps in [Getting started](/README.md) followed by the [Prerequisites](##Prerequisites), we are all set to run the complaince tests.
|
||||||
|
|
||||||
:o: All the RISCOF commands will be run from `$SERV/verif`
|
:o: All the RISCOF commands will be run from the workspace
|
||||||
|
|
||||||
riscof run --config=config.ini \
|
riscof run --config=$SERV/verif/config.ini \
|
||||||
--suite=riscv-arch-test/riscv-test-suite/rv32i_m/I \
|
--suite=riscv-arch-test/riscv-test-suite/rv32i_m/I \
|
||||||
--env=riscv-arch-test/riscv-test-suite/env
|
--env=riscv-arch-test/riscv-test-suite/env
|
||||||
|
|
||||||
|
@ -71,4 +69,4 @@ After completing all the steps in [Getting started](/README.md) followed by the
|
||||||
|
|
||||||
> :bulb: Other optional arguments of RISCOF command can be found [here](https://riscof.readthedocs.io/en/stable/commands.html#run)
|
> :bulb: Other optional arguments of RISCOF command can be found [here](https://riscof.readthedocs.io/en/stable/commands.html#run)
|
||||||
|
|
||||||
When RISCOF run command successfully executed: an `html` report is generated which depicts the results of the tests. And a directory named `riscof_work` is created inside `$SERV/verif/` which contains all the log files, signatures, executeables for Reference model and/or DUT.
|
When RISCOF run command successfully executed: an `html` report is generated which depicts the results of the tests. And a directory named `riscof_work` is created in the workspace which contains all the log files, signatures, executeables for Reference model and/or DUT.
|
|
@ -1,14 +1,14 @@
|
||||||
[RISCOF]
|
[RISCOF]
|
||||||
ReferencePlugin=sail_cSim
|
ReferencePlugin=sail_cSim
|
||||||
ReferencePluginPath=./plugin-sail_cSim
|
ReferencePluginPath=plugin-sail_cSim
|
||||||
DUTPlugin=serv
|
DUTPlugin=serv
|
||||||
DUTPluginPath=./plugin-serv
|
DUTPluginPath=plugin-serv
|
||||||
|
|
||||||
[serv]
|
[serv]
|
||||||
pluginpath=./plugin-serv
|
pluginpath=plugin-serv
|
||||||
ispec=./plugin-serv/serv_isa.yaml
|
ispec=plugin-serv/serv_isa.yaml
|
||||||
pspec=./plugin-serv/serv_platform.yaml
|
pspec=plugin-serv/serv_platform.yaml
|
||||||
target_run=1
|
target_run=1
|
||||||
|
|
||||||
[sail_cSim]
|
[sail_cSim]
|
||||||
pluginpath=./plugin-sail_cSim
|
pluginpath=plugin-sail_cSim
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
#
|
|
||||||
# This is free and unencumbered software released into the public domain.
|
|
||||||
#
|
|
||||||
# Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
||||||
# distribute this software, either in source code form or as a compiled
|
|
||||||
# binary, for any purpose, commercial or non-commercial, and by any
|
|
||||||
# means.
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
with open(sys.argv[1], "rb") as f:
|
|
||||||
cnt = 3
|
|
||||||
s = ["00"]*4
|
|
||||||
while True:
|
|
||||||
data = f.read(1)
|
|
||||||
if not data:
|
|
||||||
print(''.join(s))
|
|
||||||
exit(0)
|
|
||||||
s[cnt] = "{:02X}".format(data[0])
|
|
||||||
if cnt == 0:
|
|
||||||
print(''.join(s))
|
|
||||||
s = ["00"]*4
|
|
||||||
cnt = 4
|
|
||||||
cnt -= 1
|
|
|
@ -17,8 +17,9 @@ class sail_cSim(pluginTemplate):
|
||||||
if config is None:
|
if config is None:
|
||||||
logger.error("Config node for sail_cSim missing.")
|
logger.error("Config node for sail_cSim missing.")
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
config_dir = kwargs.get('config_dir')
|
||||||
self.num_jobs = str(config['jobs'] if 'jobs' in config else 1)
|
self.num_jobs = str(config['jobs'] if 'jobs' in config else 1)
|
||||||
self.pluginpath = os.path.abspath(config['pluginpath'])
|
self.pluginpath = os.path.join(config_dir, config['pluginpath'])
|
||||||
self.sail_exe = { '32' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_RV32"),
|
self.sail_exe = { '32' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_RV32"),
|
||||||
'64' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_RV64")}
|
'64' : os.path.join(config['PATH'] if 'PATH' in config else "","riscv_sim_RV64")}
|
||||||
self.isa_spec = os.path.abspath(config['ispec']) if 'ispec' in config else ''
|
self.isa_spec = os.path.abspath(config['ispec']) if 'ispec' in config else ''
|
||||||
|
@ -105,4 +106,4 @@ class sail_cSim(pluginTemplate):
|
||||||
execute+=coverage_cmd
|
execute+=coverage_cmd
|
||||||
|
|
||||||
make.add_target(execute)
|
make.add_target(execute)
|
||||||
make.execute_all(self.work_dir)
|
make.execute_all(self.work_dir)
|
||||||
|
|
|
@ -13,14 +13,13 @@ class serv(pluginTemplate):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
sclass = super().__init__(*args, **kwargs)
|
sclass = super().__init__(*args, **kwargs)
|
||||||
config = kwargs.get('config')
|
config = kwargs.get('config')
|
||||||
|
config_dir = kwargs.get('config_dir')
|
||||||
if config is None:
|
if config is None:
|
||||||
print("Please enter input file paths in configuration.")
|
print("Please enter input file paths in configuration.")
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
self.dut_exe = os.path.join(config['PATH'] if 'PATH' in config else "","serv")
|
self.pluginpath=os.path.join(config_dir, config['pluginpath'])
|
||||||
self.num_jobs = str(config['jobs'] if 'jobs' in config else 1)
|
self.isa_spec = os.path.join(config_dir, config['ispec'])
|
||||||
self.pluginpath=os.path.abspath(config['pluginpath'])
|
self.platform_spec = os.path.join(config_dir, config['pspec'])
|
||||||
self.isa_spec = os.path.abspath(config['ispec'])
|
|
||||||
self.platform_spec = os.path.abspath(config['pspec'])
|
|
||||||
if 'target_run' in config and config['target_run']=='0':
|
if 'target_run' in config and config['target_run']=='0':
|
||||||
self.target_run = False
|
self.target_run = False
|
||||||
else:
|
else:
|
||||||
|
@ -35,21 +34,14 @@ class serv(pluginTemplate):
|
||||||
-T '+self.pluginpath+'/env/link.ld\
|
-T '+self.pluginpath+'/env/link.ld\
|
||||||
-I '+self.pluginpath+'/env/\
|
-I '+self.pluginpath+'/env/\
|
||||||
-I ' + archtest_env + ' {1} -o {2} {3}'
|
-I ' + archtest_env + ' {1} -o {2} {3}'
|
||||||
self.objcopy_cmd = 'riscv64-unknown-elf-objcopy -O binary {0} {1}.bin'
|
|
||||||
self.objdump_cmd = 'riscv64-unknown-elf-objdump -D {0} > {1}.disass'
|
|
||||||
self.hexgen_cmd = 'python3 makehex.py {0}/{1}.bin > {0}/{1}.hex'
|
|
||||||
|
|
||||||
build_serv = 'cd $WORKSPACE \n \
|
add_mdu = 'fusesoc library add mdu https://github.com/zeeshanrafique23/mdu'
|
||||||
fusesoc library add mdu https://github.com/zeeshanrafique23/mdu\n'
|
utils.shellCommand(add_mdu).run()
|
||||||
build_serv = build_serv + 'fusesoc run --target=verilator_tb --flag=mdu\
|
|
||||||
|
build_serv = 'fusesoc run --target=verilator_tb --flag=mdu\
|
||||||
--build --build-root=servant_test servant\
|
--build --build-root=servant_test servant\
|
||||||
--memsize=8388608 --compressed=1'
|
--memsize=8388608 --compressed=1'
|
||||||
utils.shellCommand(build_serv).run()
|
utils.shellCommand(build_serv).run()
|
||||||
self.sigdump_cmd = 'cd $WORKSPACE/servant_test/verilator_tb \n\
|
|
||||||
./Vservant_sim\
|
|
||||||
+timeout=100000000000\
|
|
||||||
+signature={0}/DUT-serv.signature\
|
|
||||||
+firmware={0}/{1}.hex'
|
|
||||||
|
|
||||||
def build(self, isa_yaml, platform_yaml):
|
def build(self, isa_yaml, platform_yaml):
|
||||||
ispec = utils.load_yaml(isa_yaml)['hart0']
|
ispec = utils.load_yaml(isa_yaml)['hart0']
|
||||||
|
@ -64,29 +56,54 @@ class serv(pluginTemplate):
|
||||||
self.compile_cmd = self.compile_cmd+' -mabi='+('lp64 ' if 64 in ispec['supported_xlen'] else 'ilp32 ')
|
self.compile_cmd = self.compile_cmd+' -mabi='+('lp64 ' if 64 in ispec['supported_xlen'] else 'ilp32 ')
|
||||||
|
|
||||||
def runTests(self, testList):
|
def runTests(self, testList):
|
||||||
for testname in testList:
|
for testentry in testList.values():
|
||||||
testentry = testList[testname]
|
|
||||||
test = testentry['test_path']
|
test = testentry['test_path']
|
||||||
test_dir = testentry['work_dir']
|
test_dir = testentry['work_dir']
|
||||||
file_name = 'serv-{0}'.format(test.rsplit('/',1)[1][:-2])
|
file_name = os.path.basename(test)[:-2]
|
||||||
|
|
||||||
elf = '{0}.elf'.format(file_name)
|
elf = file_name+'.elf'
|
||||||
compile_macros= ' -D' + " -D".join(testentry['macros'])
|
compile_macros= ' -D' + " -D".join(testentry['macros'])
|
||||||
marchstr = testentry['isa'].lower()
|
marchstr = testentry['isa'].lower()
|
||||||
|
|
||||||
compile_run = self.compile_cmd.format(marchstr, test, elf, compile_macros)
|
compile_run = self.compile_cmd.format(marchstr, test, elf, compile_macros)
|
||||||
utils.shellCommand(compile_run).run(cwd=test_dir)
|
utils.shellCommand(compile_run).run(cwd=test_dir)
|
||||||
|
|
||||||
objcopy_run = self.objcopy_cmd.format(elf,file_name)
|
objcopy_run = f'riscv64-unknown-elf-objcopy -O binary {elf} {file_name}.bin'
|
||||||
utils.shellCommand(objcopy_run).run(cwd=test_dir)
|
utils.shellCommand(objcopy_run).run(cwd=test_dir)
|
||||||
|
|
||||||
objdump_run = self.objdump_cmd.format(elf,file_name)
|
objdump_run = f'riscv64-unknown-elf-objdump -D {elf} > {file_name}.disass'
|
||||||
utils.shellCommand(objdump_run).run(cwd=test_dir)
|
utils.shellCommand(objdump_run).run(cwd=test_dir)
|
||||||
|
|
||||||
hexgen_run = self.hexgen_cmd.format(test_dir,file_name)
|
self.makehex(f"{test_dir}/{file_name}.bin", f"{test_dir}/{file_name}.hex")
|
||||||
utils.shellCommand(hexgen_run).run()
|
|
||||||
|
|
||||||
sigdump_run = self.sigdump_cmd.format(test_dir,file_name)
|
#The behavior of --build-root in FuseSoC has changed since version 2.2.1
|
||||||
utils.shellCommand(sigdump_run).run()
|
#Check first for executable model in the new location and else fall back
|
||||||
|
#to the old one
|
||||||
|
exe = 'servant_test/verilator_tb/Vservant_sim'
|
||||||
|
if not os.path.exists(exe):
|
||||||
|
exe = 'servant_test/servant_1.2.1/verilator_tb/Vservant_sim'
|
||||||
|
|
||||||
|
sigdump_run = [exe,
|
||||||
|
"+timeout=1000000000",
|
||||||
|
f"+signature={test_dir}/DUT-serv.signature",
|
||||||
|
f"+firmware={test_dir}/{file_name}.hex"]
|
||||||
|
|
||||||
|
utils.shellCommand(' '.join(sigdump_run)).run()
|
||||||
if not self.target_run:
|
if not self.target_run:
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
|
def makehex(self, binfile, hexfile):
|
||||||
|
with open(binfile, "rb") as f, open(hexfile, "w") as fout:
|
||||||
|
cnt = 3
|
||||||
|
s = ["00"]*4
|
||||||
|
while True:
|
||||||
|
data = f.read(1)
|
||||||
|
if not data:
|
||||||
|
fout.write(''.join(s)+'\n')
|
||||||
|
return
|
||||||
|
s[cnt] = "{:02X}".format(data[0])
|
||||||
|
if cnt == 0:
|
||||||
|
fout.write(''.join(s)+'\n')
|
||||||
|
s = ["00"]*4
|
||||||
|
cnt = 4
|
||||||
|
cnt -= 1
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit da638bafbc6d69f75ffc09769cfe7e3a45b41a3a
|
|
Loading…
Add table
Add a link
Reference in a new issue