| 1 | [wiki:Component SocLib Components General Index] |
| 2 | |
| 3 | = !VciSimHelper = |
| 4 | |
| 5 | == 1) Functional Description == |
| 6 | |
| 7 | This VCI target is a synthetic component that can be used to instrument |
| 8 | the simulation process. It can make the simulation stop, exit or crash different ways. |
| 9 | |
| 10 | It has four mapped register accepting only writes. |
| 11 | |
| 12 | Possible actions are: |
| 13 | * Make the simulator call `sc_stop()` |
| 14 | * Make the simulator call `exit( val )`, with a given `val` |
| 15 | * Make the simulator throw an exception with a given value in message |
| 16 | * Make the simulator pause (i.e. wait for a keyboard event) |
| 17 | |
| 18 | Registers are: |
| 19 | * `SIMHELPER_SC_STOP` (at offset 0x0): Call `sc_stop()` |
| 20 | * `SIMHELPER_END_WITH_RETVAL` (at offset 0x4): Call `exit(val)` |
| 21 | * `SIMHELPER_EXCEPT_WITH_VAL` (at offset 0x8): Create a `soclib::exception::RunTimeError("Simulation yielded error level "+val)` |
| 22 | * `SIMHELPER_PAUSE_SIM` (at offset 0xc): Pause simulation |
| 23 | |
| 24 | == 2) Component definition & usage == |
| 25 | |
| 26 | source:trunk/soclib/soclib/module/verification_component/vci_simhelper/metadata/vci_simhelper.sd |
| 27 | |
| 28 | See [wiki:SoclibCc/VciParameters SoclibCc/VciParameters] |
| 29 | {{{ |
| 30 | Uses( 'caba:vci_simhelper', **vci_parameters ) |
| 31 | }}} |
| 32 | |
| 33 | == 3) CABA Implementation == |
| 34 | |
| 35 | === CABA sources === |
| 36 | |
| 37 | * interface : source:trunk/soclib/soclib/module/verification_component/vci_simhelper/caba/source/include/vci_simhelper.h |
| 38 | * implementation : source:trunk/soclib/soclib/module/verification_component/vci_simhelper/caba/source/src/vci_simhelper.cpp |
| 39 | |
| 40 | |
| 41 | === CABA Constructor parameters === |
| 42 | |
| 43 | {{{ |
| 44 | VciSimhelper( |
| 45 | sc_module_name name, // Instance name |
| 46 | const soclib::common::IntTab &index, // Target index |
| 47 | const soclib::common::MappingTable &mt) // Mapping Table |
| 48 | }}} |
| 49 | |
| 50 | Example instanciation: |
| 51 | {{{ |
| 52 | VciSimhelper simhelper("simhelper", |
| 53 | IntTab(2,3), |
| 54 | mapping_table ); |
| 55 | }}} |
| 56 | |
| 57 | === CABA Ports === |
| 58 | |
| 59 | * sc_in<bool> '''p_resetn''' : Global system reset |
| 60 | * sc_in<bool> '''p_clk''' : Global system clock |
| 61 | * soclib::common::!VciTarget<vci_param> '''p_vci''' : The VCI port |