Simulation
BansheeSimulation
Bases: Simulation
A simulation running on Banshee.
The return code of the simulation is returned directly as the return code of the command launching the simulation.
Source code in util/sim/Simulation.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
|
__init__(banshee_cfg=None, **kwargs)
Constructor for the BansheeSimulation class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
banshee_cfg |
A Banshee config file. |
None
|
|
kwargs |
Arguments passed to the base class constructor. |
{}
|
Source code in util/sim/Simulation.py
292 293 294 295 296 297 298 299 300 301 |
|
QuestaSimulation
Bases: QuestaVCSSimulation
An RTL simulation running on QuestaSim.
Source code in util/sim/Simulation.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
|
QuestaVCSSimulation
Bases: RTLSimulation
An RTL simulation running on QuestaSim or VCS.
QuestaSim and VCS print out the simulation return code in the simulation log. This must be parsed to extract the return code.
If the simulation is launched through a custom command which implements external verification logic, the return code of the command is used to determine the exit status of the simulation.
Source code in util/sim/Simulation.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
|
RTLSimulation
Bases: Simulation
A simulation run on an RTL simulator.
An RTL simulation is launched through a simulation binary built in advance from some RTL design. The path to the simulation binary is all that is needed to launch a simulation.
Alternatively, a custom command can be specified to launch the
simulation. The custom command generally invokes the RTL simulator
binary behind the scenes and executes some additional verification
logic at the end of the simulation. As a custom command can implement
any verification logic, simulations launched through a custom command
are considered unsuccessful if the return code of the custom command
is non-null. The custom command may use Mako templating syntax. See
the __init__
method implementation for more details on the dynamic
arguments which can be used in the command template.
Source code in util/sim/Simulation.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
__init__(sim_bin=None, cmd=None, **kwargs)
Constructor for the RTLSimulation class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sim_bin |
The simulation binary. |
None
|
|
kwargs |
Arguments passed to the base class constructor. |
{}
|
Source code in util/sim/Simulation.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
Simulation
Bases: object
Provides a common interface to manage simulations.
Source code in util/sim/Simulation.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
__init__(elf=None, dry_run=False, retcode=0, run_dir=None, name=None)
Constructor for the Simulation class.
A Simulation object is defined at a minimum by a software binary to be simulated on the desired hardware. The hardware is implicitly determined by the simulation command.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
elf |
The software binary to simulate. |
None
|
|
run_dir |
The directory where to launch the simulation command. If none is passed, the current working directory is assumed. |
None
|
|
dry_run |
A preview of the simulation command will be displayed without actually launching the simulation. |
False
|
Source code in util/sim/Simulation.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
completed()
Return whether the simulation completed.
Source code in util/sim/Simulation.py
84 85 86 87 88 89 90 91 |
|
get_cpu_time()
Return the CPU time [s] taken to run the simulation.
Source code in util/sim/Simulation.py
113 114 115 |
|
get_retcode()
Get the return code of the simulation.
Source code in util/sim/Simulation.py
93 94 95 96 97 98 99 |
|
get_simulation_time()
Return the execution time [ns] of the binary in simulation.
Source code in util/sim/Simulation.py
109 110 111 |
|
launch(dry_run=None)
Launch the simulation.
Launch the simulation by invoking the command stored in the
cmd
attribute of the class. Subclasses are required to define
a non-empty cmd
attribute prior to invoking this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dry_run |
A preview of the simulation command is displayed without actually launching the simulation. |
None
|
Source code in util/sim/Simulation.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
launched()
Return whether the simulation was launched.
Source code in util/sim/Simulation.py
77 78 79 80 81 82 |
|
print_log()
Print a log of the simulation to stdout.
Source code in util/sim/Simulation.py
117 118 119 120 |
|
print_status()
Print a status message to stdout.
The status message reports whether the test is still running or, if it completed, whether it was successful or failed.
Source code in util/sim/Simulation.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
successful()
Return whether the simulation was successful.
Source code in util/sim/Simulation.py
101 102 103 104 105 106 107 |
|
VCSSimulation
Bases: QuestaVCSSimulation
An RTL simulation running on VCS.
Source code in util/sim/Simulation.py
270 271 272 273 274 275 276 277 278 279 280 281 282 |
|
VerilatorSimulation
Bases: RTLSimulation
An RTL simulation running on Verilator.
The return code of the simulation is returned directly as the return code of the command launching the simulation.
Source code in util/sim/Simulation.py
178 179 180 181 182 183 184 |
|