

See Figure 6.23īecause the result of the operation will be one clock cycle later than the input, the multiplier and the result will differ by one line, which does not seem to match, but does not affect the analysis of the experimental results.įigure 6.23 Text displays operation result Summary and Reflection See Figure 6.22.Īfter a certain delay, outputs will display in Transcript. Repeat previous step, to start ModelSim to simulate.Click OK (three times) to finish the setting. the red ellipse to add the test bench file.Make the name be consistent with tb file. In Compile test bench, click Test Benches to add tb simulation file.Set the testbench file: Assignments -> Settings.This simulation stops after 1000 clock cycles.Īfter the compilation, the testbench file is added to the ModelSim for simulation, the specific steps are as follows: When writing the testbench file, first mark the time unit of the simulation at the beginning, this experiment is 1 ns, then instantiate the project that needs to be simulated into the testbench file, define the clock cycle and the simulation conditions, and stop the simulation after a certain time. $monitor (“%d * %d = %d”, count, sw, mult_res) Define the clock required for the simulation and display the results in text form S1 is the instance of simulation module Method 2: Write a testbench file for simulation Since waveform editing efficiency is relatively low, the use of simulation testbench file is encouraged.
HOW TO SHOW CIRCUIT IN MODELSIM ALTERA CODE
The revised code is as follows: module pll_sys_rst(
HOW TO SHOW CIRCUIT IN MODELSIM ALTERA VERIFICATION

Select the multiplication type to be Unsigned.After adding the LPM_MULT IP ( IP Catalog -> Library -> Basic Functions -> Arithmatic -> LPM_MULT) and saving the path, the setting window of the multiplier is popped up, as shown in Figure 6.2, and the two input data is set to eight bits as required.Step 2: The multiplier IP core setting steps are as follows: The value of the switch is used as the first input of the multiplier, the value of the counter is the second input, and the result of the calculation is output. The first step: the establishment of the main program framework module mult_sim ( Only one counter, one PLL and one multiplier are used in the program. ModelSim, different from the previous experiment, when building the project, you need to add the simulation tool to be used in the EDA tool selection window. Our program can be simulated to achieve inspection and error correction. ModelSim is an HDL language simulation software. Since learning uses of the simulation tools and the new IP core, there is no introduction and hardware design part.


