You are on page 1of 6

A session with MODEL SIM simulator The MODELSIM simulator can be either used as a standalone program or integrated into

ALTERA or XILINX synthesis en ironment! The synthesis en ironment pro ides some con enient tool "or #$DL program entry! To in o%e MODELSIM& double clic% the MODELSIM icon on the program 'indo'! The 'elcome dialog has option and main pro(ect 'indo' appears simultaneously! This is being gi en belo'

Figure 5.1 Welcome Dialog Box

Figure 5. Main !ro"ect Win#ow

The 'elcome dialog has options to create ne' pro(ect to create ne' pro(ect& open a pro(ect& open documentation and proceed to MODELSIM! )lic% on create ne' pro(ect option! The same can be done by clic%ing proceed to Modelsim option and then to "ile* Ne'* pro(ects "rom the Modelsim Main +indo'! This is sho'n belo'

Figure 5.$ %reate !ro"ect win#ow Enter pro(ect name and then the pro(ect location! Let,s put pro(ect name as hal" adder! The main 'indo' appears as sho'n belo'

Figure 5.& Mo#el sim E#itor Win#ow Then clic% on "ile * ne' * source* hdl to in o%e the $DL editor as sho'n belo'

Figure 5.5 '(DL e#itor Win#ow No' the #$DL code is 'ritten in this editor!

Figure 5.) '(DL !rogram o* hal* a##er Then clic% on "ile sa e tool or select "ile* sa e "rom the menu! -i e the "ile name 'ith e.tension ! hd and the press O/! Then compile the code "or chec%ing any synta. error! The icon "or the compile is belo' the "ile option! +hen you clic% compile option& the "lo'ing dialog bo. 'ill appear 'here sam is the "ile name 'hich 'as last compiled!

Figure 5.+ %om,lier (DL source Win#ow Then select the compile option! The result o" the compilation appears on the main 'indo' as sho'n belo'!

Figure 5.- MODELSIM main Win#ow I" there is any error in the code& then it 'ill be sho'n in the abo e 'indo' 'ith red color line indicating error 'ith remar%s and error line! Let,s introduce error in the code 'here cout is assigned as cout01 a and b & no semi column in placed! The "ollo'ing error 'ill appear on the main 'indo'!

Figure 5.. %om,ilation /esult Win#ows I" there is any error in the code& then clic% on the error line indicated by red color! It 'ill directly come to your main program 'indo' 'here #$DL code is 'ritten! )orrect the mista%e& and sa e the "ile! Then clic% on the compile option and then cloc% on the Done

icon! Then go to the tool bar and select design * load design option in the main 'indo'& the "ollo'ing thing 'ill appear on the 'indo'!

Figure 5.10 Loa# Design Win#ows In this 'indo' all the entity 'ill be there! Select the entity 'hich you ha e designed and the clic% on the ADD button and then LOAD button! The "ollo'ing things 'ill appear on the main simulation 'indo'!

Figure 5.11 Simulate #is,la1 Win#ows Then go to #ie'* signal! This 'ill launch a ne' 'a e"orm 'indo' as sho'n belo'& 'here the entire signal is present!

Figure 5.1 Signal Win#ows

In this 'indo'& a& b& c& d& m2& m3& m4& m5 and m are the signal used in the entity declaration o" the program compiled! In the signal 'a e"orm 'indo'& go to Edit& the "ollo'ing 'indo' 'ill appear on the screen

Figure 5.1$ Signal 2alue *orcing win#ow There are so many options a ailable! I" 'e 'ant to gi e any signal as cloc% then chose cloc3 option! I" 'e 'ant to gi e some static alues li%e 2& 3 or li%e ector types o" input& then chose Force option! Then gi e all the alues o" the input ports! Once all the alue is gi en& go to 'iew option in the signal 'indo' and select wa2e4 signals in #esign!

)lic% on the signal in #esign option& this 'ill display a 'a e"orm 'indo' 'here all the signals 'ill be there!

Figure 5.1& Wa2e*orm 2iewing win#ow

No' clic% on the /un icon as indicated in the 'a e"orm 'indo'! No' depending upon the alues o" input signals on the port& in this case d& cl%& reset& the output 'ill be generated depending upon the logic o" the code! In the abo e #$DL code "or D "ilp is such that 'hen reset12 & then 601,2, & other'ise depending upon the negati e edge on the cl%& the 6 "ollo's the alue o" d! This is gi en belo'! No' designer can eri"y the output!

Figure 5.15 Simulation result

You might also like