Using_ModelSim (1162592), страница 3

Файл №1162592 Using_ModelSim (Семинары) 3 страницаUsing_ModelSim (1162592) страница 32019-09-20СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 3)

It is the ability to combinesignals and create aliases. It is useful when signals of interest are not named as well as they should be, or thegiven names are inconvenient for the purposes of simulation. In this example, we rename the start signal to go byhighlighting the start signal and selecting Tools > Combine Signals.... The window in Figure 15 will appear.Figure 15.

Combine signals window.In the text field labeled Result name type go and press the OK button. This will cause a new signal to appear in thesimulation window. It will be named go, but it will have an orange diamond next to its name to indicate that it is analias. Once the go alias is created, the original start input is no longer needed in the simulation window, so removeit by highlighting it and pressing the delete key.

Your simulation window should now look as in Figure 16.14Altera Corporation - University ProgramMay 2016U SING M ODEL S IM TO S IMULATE L OGIC C IRCUITS IN V ERILOG D ESIGNSFor Quartus Prime 16.0Figure 16. Simulation window with aliased signals.Now that we set up a set of signals to observe we can begin simulating the circuit. There are two ways to runa simulation in ModelSim: manually or by using scripts. A manual simulation allows users to apply inputs andadvance the simulation time to see the results of the simulation in a step-by-step fashion.

A scripted simulationallows the user to create a script where the sequence of input stimuli are defined in a file. ModelSim can read the fileand apply input stimuli to appropriate signals and then run the simulation from beginning to end, displaying resultsonly when the simulation is completed. In this tutorial, we perform the simulation manually.In this simulation, we use a clock with a 100 ps period. At every negative edge of the clock we assign new valuesto circuit inputs to see how the circuit behaves.

To set the clock period, right-click on the clock signal and selectClock... from the pop-up menu. In the window that appears, set the clock period to 100 ps and the first edge to bethe falling edge, as shown in Figure 17. Then click OK.Altera Corporation - University ProgramMay 201615U SING M ODEL S IM TO S IMULATE L OGIC C IRCUITS IN V ERILOG D ESIGNSFor Quartus Prime 16.0Figure 17. Set the clock period.We begin the simulation by resetting the circuit.

To reset the circuit, set the resetn signal low by right-clicking on itand selecting the Force... option from the pop-up menu. In the window that appears, set Value to 0 and click OK.In a similar manner, set the value of the go signal to 0. Now that the initial values for some of the signals are set, wecan perform the first step of the simulation. To do this, locate the toolbar buttons shown in Figure 18.Figure 18. Simulation control buttons on the toolbar.The toolbar buttons shown in Figure 18 are used to step through the simulation.

The left-most button is the restartbutton, which causes the simulation window to be cleared and the simulation to be restarted. The text field, shownwith a 100 ps string inside it, defines the amount of time that the simulation should run for when the Run button (tothe right of the text field) is pressed. The remaining three buttons, Continue, Run -All and Break, can be used toresume, start and interrupt a simulation, respectively. We will not need them in this tutorial.To run a simulation for 100 ps, set the value in the text field to 100 ps and press the Run button.

After the simulationrun for 100 ps completes, you will see the state of the circuit as shown in Figure 19. You can change the time scaleof your waveform by going to View > Zoom > Zoom Range.... Change the end time to 1200 ps and press OK.16Altera Corporation - University ProgramMay 2016U SING M ODEL S IM TO S IMULATE L OGIC C IRCUITS IN V ERILOG D ESIGNSFor Quartus Prime 16.0Figure 19.

Simulation results after 100 ps.In the figure, each signal has a logic state. The first two signals, A and B, are assigned a value between 0 and 1 in ablue color. This value indicates high impedance, and means that these signals are not driven to any logic state.

Thego and resetn signals are at a logic 0 value thereby resetting the circuit. The clock signal toggles state every 50 ps,starting with a falling edge at time 0, a rising edge at time 50 ps and another falling edge at 100 ps.Now that the circuit is reset, we can begin testing to see if it operates correctly for desired inputs. To test the serialadder we will add numbers 143 and 57, which should result in a sum of 200. We can set A and B to 143 and 57,respectively, using decimal notation.

To specify a value for A in decimal, right-click on it, and choose Force...from the pop-up menu. Then, in the Value field put 10#143. The 10# prefix indicates that the value that follows isspecified in decimal. Similarly, set the Value field of B to 10#57.To see the decimal, rather than binary, values of buses in the waveform window we need to change the Radix of Aand B to unsigned. To change the radix of these signals, highlight them in the simulation window and select Format> Radix > Unsigned, as shown in Figure 20. Change the radix of the sum signal to unsigned as well.Altera Corporation - University ProgramMay 201617U SING M ODEL S IM TO S IMULATE L OGIC C IRCUITS IN V ERILOG D ESIGNSFor Quartus Prime 16.0Figure 20.

Changing the radix of A, B and sum signals.Now that inputs A and B are specified, set resetn to 1 to stop the circuit from resetting. Then set go to 1 to beginserial addition, and press the Run button to run the simulation for another 100 ps. The output should be as illustratedin Figure 21. Notice that the values of inputs A and B are shown in decimal as is the sum. The circuit also recognizeda go signal and moved to state 01 to begin computing the sum of the two inputs.18Altera Corporation - University ProgramMay 2016U SING M ODEL S IM TO S IMULATE L OGIC C IRCUITS IN V ERILOG D ESIGNSFor Quartus Prime 16.0Figure 21. Simulation results after 200 ps.To complete the operation, the circuit will require 9 clock cycles. To fast forward the simulation to see the result,specify 900 ps in the text field next to the run button, and press the run button. This brings the simulation to time1100 ps, at which point a result of summation is shown on the sum signal, as illustrated in Figure 22.Altera Corporation - University ProgramMay 201619U SING M ODEL S IM TO S IMULATE L OGIC C IRCUITS IN V ERILOG D ESIGNSFor Quartus Prime 16.0Figure 22.

Simulation results after 1100 ps.We can see that the result is correct and the finite state machine controlling the serial adder entered state 11, inwhich it awaits the go signal to become 0. Once we set the go signal to 0 and advance the simulation by 100 ps, thecircuit will enter state 00 and await a new set of inputs for addition.

The simulation result after 1200 ps is shown inFigure 23.20Altera Corporation - University ProgramMay 2016U SING M ODEL S IM TO S IMULATE L OGIC C IRCUITS IN V ERILOG D ESIGNSFor Quartus Prime 16.0Figure 23. Simulation results after 1200 ps.At this point, we can begin the simulation for a new set of inputs as needed, repeating the steps described above. Wecan also restart the simulation by pressing the restart button to begin again from time 0.By using the functional simulation we have shown that the serial.v file contains an accurate Verilog HDL descriptionof a serial adder. However, this simulation did not verify if the circuit implemented on an FPGA is correct. Thisis because we did not use a synthesized, placed and routed circuit as input to the simulator. The correctness of theimplementation, including timing constraints can be verified using timing simulation.5Timing Simulation with ModelSimTiming simulation is an enhanced simulation, where the logical functionality of a design is tested in the presence ofdelays.

Any change in logic state of a wire will take as much time as it would on a real device. This forces the inputsto the simulation be realistic not only in terms of input values and the sequence of inputs, but also the time when theinputs are applied to the circuit.For example, in the previous section we simulated the sample design and used a clock period of 100 ps. This clockperiod is shorter than the minimum clock period for this design, and hence the timing simulation would fail toproduce the correct result.

To obtain the correct result, we have to account for delays when running the simulationand use a clock frequency for which the circuit operates correctly.Altera Corporation - University ProgramMay 201621U SING M ODEL S IM TO S IMULATE L OGIC C IRCUITS IN V ERILOG D ESIGNSFor Quartus Prime 16.0For Altera FPGA-based designs the delay information is available after the design is synthesized, placed and routed,and is generated by Quartus Prime CAD software. The project for this part of the tutorial has been created for youin the example/timing subdirectory; it has been configured to work with the DE2-115 board.Note: timing simulations are only supported by Cyclone IV and Stratix IV devices.5.1Setting up a Quartus Prime Project for Timing Simulation with ModelSimTo perform timing simulation we need to set up Quartus Prime software to generate the necessary delay informationfor ModelSim by setting up EDA Tools for simulation in the Quartus Prime project.To set up EDA Tools for simulation, open the Quartus Prime project in example/timing subdirectory, and selectAssignment > Settings....

A window shown in Figure 24 will appear. The window consists of a list on the lefthand side to select the settings category and a window area on the right-hand side that displays the settings for agiven category. Select Simulation from the EDA Tool Settings category to see the screen shown on the right-handside of Figure 24.The right-hand side of the figure contains the tool name at the top, EDA Netlist Writer settings in the middle, andNativeLink settings at the bottom.

Характеристики

Тип файла
PDF-файл
Размер
1,39 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов семинаров

Семинары
Part 1
Seminar 1
DE0_CV
DE0_CV.qsf
Datasheet
Clock
CDCLVC1104PWR.pdf
EPCQ
EPCQ64.pdf
FPGA
cyclone5_handbook.pdf
cyclone_5_datasheet.pdf
IR Receiver and Emitter
IR12_21C_TR8.pdf
IRM_V538_TR1.pdf
Power
BZX84C5V1.pdf
Optimizing_TPS62130_Output_Filter.pdf
TPS62130EVM.pdf
tps62085.pdf
tps62130.pdf
tps73701.pdf
SDRAM
IS42S16320D.pdf
UART TO USB
DS_FT232R.pdf
VIDEO-DAC
ADV7123.pdf
DE0_Nano
DE0_Nano.qsf
DE0_Nano_Datasheets
ADC.pdf
DE0_Nano_Schematic.pdf
Digital_Accelerometer.pdf
Flash_Memory.pdf
I2C_2K_EEPROM.pdf
Linear_Regulator.pdf
SDRAM.pdf
Seminar 3
modules
adder.v
fsm.v
fsm.v.bak
register.v
Seminar 4
simulation_lab
funcitonal
db
serial.db_info
serial.sld_design_entry.sci
serial.qpf
serial.qsf
serial.qws
serial.v
serial_assignment_defaults.qdf
Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
7021
Авторов
на СтудИзбе
260
Средний доход
с одного платного файла
Обучение Подробнее