== How to run a simulation == [[TOC]] This tutorial explains how to setup and run a simulation. Note that the external simulation environment is not yet integrated into MATLAB/Simulink. To run a simulation, you need to 1. Set up the build environment as explained in "How to setup build environment" tutorial 2. Create a top level VHDL file of your design from within MATLAB (if using the provided Simulink CRKit Framework, then the top Input/Output (IO) signals should match the IOs within the testbench environment) 3. Port top file into the external testbench environment 4. Build the simulation testbench by either using the currently available testcases, or create your own test scenarios 5. Validate your design in Modelsim === Testbench Overview === The testbench architecture is as shown in Figure 1. We have some drivers which provide the input stimuli into the DUT. The monitors collect the output data and record any error conditions. The simulation manager manages the whole simulation transactions. The different test scenarios are linked to the simulation manager and are invoked during testbench build time. We may have multiple test cases using the same testbench. Each testcase has its own ethernet command file, those cmd files contain ethernet packet data for transmission into DUT. Note that all communications with CRKit HW occur through the ethernet link. __Figure 1 - Testbench Overview__ [[BR]][[BR]] [[Image(tb_arch.jpg, 800px)]] [[BR]][[BR]] === Build Simulation Environment === * [wiki:Software/Firmware/Framework/tutorial/build/sim/R1 R1] - build R1 testbench * [wiki:Software/Firmware/Framework/tutorial/build/sim/R3 R3] - build R3 testbench [..]