commit | 9ac4f9c8b924b79eb7d3581b29346a612f705751 | [log] [tgz] |
---|---|---|
author | Rupert Swarbrick <rswarbrick@lowrisc.org> | Fri Jul 03 17:18:05 2020 +0100 |
committer | Rupert Swarbrick <rswarbrick@gmail.com> | Mon Jul 06 10:08:33 2020 +0100 |
tree | c6cd6d2eefd775d6188e98ca75c8a6c953dc2d3e | |
parent | a4a9e4013612607c68086ce4534a14206928f3a6 [diff] |
Allow verilated top-levels to do work after a simulation completes Before this patch, it isn't possible for a main() function that calls VerilatorSimCtrl::Exec() to tell whether the simulation actually ran: a return value of zero might mean a successful run or it might mean the user passed --help. This patch moves the registration of a signal handler into RunSimulation() (there's no point in registering the signal handler before we start running anything) and makes ParseCommandArgs() public. This means that Exec() is now a simple wrapper around a collection of public methods which can be called separately. For example, you could have something like this: ... bool exit_app = false; int ret_code = sim_ctrl.ParseCommandArgs(argc, argv, exit_app); if (exit_app) { return ret_code; } sim_ctrl.RunSimulation(); if (!sim_ctrl.WasSimulationSuccessful()) { return 1; } do_some_postprocessing(); return 0; Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
OpenTitan is an open source silicon Root of Trust (RoT) project. OpenTitan will make the silicon RoT design and implementation more transparent, trustworthy, and secure for enterprises, platform providers, and chip manufacturers. OpenTitan is administered by lowRISC CIC as a collaborative project to produce high quality, open IP for instantiation as a full-featured product. See the OpenTitan site and OpenTitan docs for more information about the project.
This repository contains hardware, software and utilities written as part of the OpenTitan project. It is structured as monolithic repository, or “monorepo”, where all components live in one repository. It exists to enable collaboration across partners participating in the OpenTitan project.
The project contains comprehensive documentation of all IPs and tools. You can access it online at docs.opentitan.org.
Have a look at CONTRIBUTING for guidelines on how to contribute code to this repository.
Unless otherwise noted, everything in this repository is covered by the Apache License, Version 2.0 (see LICENSE for full text).