02-Creating-act- HDL Graphical Modules (Методички для ACTIVE-HDL)
Описание файла
Файл "02-Creating-act- HDL Graphical Modules" внутри архива находится в следующих папках: МЕТОДИЧКИ_для_ACTIVE-HDL, Дополнительные материалы. PDF-файл из архива "Методички для ACTIVE-HDL", который расположен в категории "". Всё это находится в предмете "схемотехника" из 2 семестр, которые можно найти в файловом архиве НИУ «МЭИ» . Не смотря на прямую связь этого архива с НИУ «МЭИ» , его также можно найти и в других разделах. .
Просмотр PDF-файла онлайн
Текст из PDF
Design Entry & ManagementLearn how to create schematic diagram andfinite state machine2Top Down Design Concepts• Start by creating a top level diagram• Push into individual symbols• Select your preferred design entry tool:• BDE – Block Diagram Editor HDE – HDL Editor FSM – Finite State Machine EditorCreate the source code• Compile the entire design sourceswww.aldec.com3Creating a Top Level Block DiagramIn this section we will implement the top level Block Diagram file tofamiliarize you with the basic concepts of the Block Diagram Editor.We will also create a State Machine module Control using top-downdesign methodology.• To create the new block diagram,double click on Add New File fromthe Files tab on the Design Browser.• Select Wizards tab and double clickBlock Diagram Wizard• Note that you can also create anempty block diagram file by selectingEmpty Files tab in the Add New Filewindow.www.aldec.comDesign Wizards simplify the creation process guiding youthrough the initial stages of design development.
Usingdesign wizards, you will create skeleton files with littleeffort.4Creating a Top Level Block Diagram• Define the following ports of the top_counter block diagram:Input Ports: START RESET CLKOutput Ports: Q [3:0]• Click Finish• Block Diagram Editor (BDE)screen with an empty diagramwill appear.www.aldec.com5Block Diagram Design Wizard - ports• To add a port, click the New button and type the name of the•••port.To change a port type, click the radio buttons in the Port directionbox.
There are four types: In Out Inout BufferTo remove any port, click on its name on the list and click theDelete button.To create a bus, add a new port name and click the Array indexesarrows to specify the bus width.www.aldec.com6Creating a Top Level Block Diagram• Click the Fub (Functional User Block) buttonon the BDE toolbarand create fub to the right of the START, RESET and CLK and inputport symbols by clicking in the one corner of the fub and draggingto the opposite corner. The fub you are drawing should look likethis:NOTE: A FUB is a symbol ‘in the process of creation’ and can be converted to a regularsymbol when completed.
The main difference between a fub and a symbol is that youcan have multiple instances of the same symbol, but only one fub.www.aldec.com7Creating a Top Level Block Diagram• Click the Wire buttonon the BDE toolbar and drag threehorizontal wires from the START, RESET and CLK input portsymbols to the U1 fub;Please note that three input pins are automatically created on the fub• Hit Esc key to return to Select mode• Double-click “Fub1” label below the•fub and change fub name to CONTROLRight click in the fub body and selectEdit to switch to Edit modewww.aldec.com8Creating a Top Level Block Diagram• Drag ‘Out’ pin from the Add New Pins window to the fub and•••drop it on the right-hand edge to create Pin1; repeat dragging tocreate Pin2Double-click Pin1 and change its name to ClockDouble-click Pin2 and change its name to RSTClick outside the fub and answer Yes when asked if you want tosave changes to the fubwww.aldec.com9Creating a Top Level Block Diagram• The completed fub should look likethis:(we will fill the fub contents aftercompleting our top level block diagram)• We can now proceed to placing the•remainingsymbolonthetop_counter block diagram.
To placethe symbol from the library, we willuse the Symbol Toolbox window.To open it, use the Show SymbolToolboxbutton.www.aldec.com10Creating a Top Level Block Diagram• The Symbol Toolbox contains compiled••units without symbols. The symbol isgenerated ”on-the-fly” when you selectthe unit you want to use. However, youcan add the symbols from other librariesor use Built-in symbols right away.Right-click the empty space and select theSelect Libraries option from the pop-upmenu.In the Libraries window, check whichlibraries you want to use in the currentdesign. Accept the changes by pressingthe OK button.www.aldec.com11Creating a Top Level Block Diagram• Drag the counter symbol to the diagram window and drop it to•the right of the Control fub.Use the Wire button to draw the following connections:from the Clock output port of the Control symbol to the CLK input of the Countersymbolfrom the RST output port of the Control symbol to the Reset input of the Countersymbol• Hit Esc to return to the Select mode• You can rename wires by double-clicking on them and typing anew name in the Segment box in the Wire Properties window.Please rename: wire drawn in point 1 above to CLOCK wire drawn in point 2 above to RSTwww.aldec.com12Creating a Top Level Block Diagram• Use the Bus button to draw the following connection:from the Q(3:0) output port of the Counter symbol to the Q(3:0) port of theblock diagram• Hit Esc to return to the Select mode• You can rename buses by double-clicking on them and typing anew name in the Segment box in the Bus Properties window.Please verify if the bus has the same name and range as theoutput of the Counter symbol.• The completed top_counter block diagram should look like below:(Please save and close the diagram)www.aldec.com13Creating a Top Level Block Diagram• Create the Functional folder, drag the top_counter block diagramto the Functional folder in the Design Browser window andreopen itNote: Symbols placed on diagrams can contain other block diagrams, statemachines or HDL files.www.aldec.com14Design Rule Checking• DRC•formally verifies thecorrectness of connectionsbetween symbols on thediagram.
Errors are reported inthe Console window. You canchange the severity level of anerror in the Check DiagramSettings window (in the Diagrammenu).You can customize these settingsto be more or less restrictiveaccording to your preferences.www.aldec.com15Creating Fub Contents• Right-click on the Control•••fub in the top level blockdiagram and select PushClick State Diagram in theType windowThe “Functional\” textshouldbeaddedautomatically before the“Control.asf” in the File boxClick OKThe Finite State Machine (FSM) editor window should open with anoutline of our state machine.www.aldec.com16Creating Fub Contents• Output ports of the machine can be either combinatorial,registered or clocked.
Clocked outputs require “Two Processes” or“Three Processes” generation pattern. To select between these,right-click the port symbol and select the Properties option fromthe pop-up menu. You can also change the port type there.www.aldec.com17Creating Fub ContentsThe FSM Editor is designed for behavioral descriptions of StateMachines. The Control unit we are going to describe will besynchronous, so we must declare one of the inputs in the diagram asour machine clock.• Right click on the CLKport symbol in theControl state diagramand select Properties.• Select the Clock checkboxinthePortProperties window.• Click OK.www.aldec.com18Creating Fub Contents• Using the FSM | State•menu option orStatebutton in the toolbar,place two states on thediagram as shown in thepicture.Don’t worry if the statenames on your diagramare different from theones in the picture, we willchange them anyway.www.aldec.com19Creating Fub Contents• You can change a state name by right-clicking on the state,selecting Properties and typing a new name in the General tab ofthe State Properties window.
If you are zoomed close enough,you can double click the old name and type the new name directlyin the diagram.• Change the first state name to•Idle.Change the second state nameto Exec, also check theHierarchical checkbox.www.aldec.com20Creating Fub Contents• You can draw transitions between states by selecting FSM |Transition from the menu or Transition button in the toolbarand clicking the starting state, then clicking the target state.• Draw transitions as shown inthis picture.• To draw a loop transition, clickinside the same state twice,slightly moving the mousebetween clicks.• To change the shape of anytransition, click on it and dragthe handles.www.aldec.com21Creating Fub Contents• You can define a reset state in your FSM by selecting FSM | RESETfrom the menu or Reset button in the toolbar, clicking close tothe Idle state to place the reset symbol, then clicking inside thestate to draw the reset transition.• Draw the reset symbol andtransition as shown in thispicturewww.aldec.com22Creating Fub Contents• To set the parameters of thereset signal, you must invoke theMachine Properties window byright-clicking on the rectangularframe surrounding the machineand selecting Properties• To change the machine name,switch to the General tab andtype the name of the machine inthe Name field.www.aldec.comRight-Clickin this area23Creating Fub Contents• Click the Reset tab in the••Machine Properties windowand select: Reset signal in the Name box Asynchronous in the Type box High in the Active Level boxClick OKTo set a trap or default state,you can switch to the Defaultstab.
These states are used incases when illegal conditionsare metwww.aldec.com24Creating Fub Contents• You can add conditions to the•transitions by selecting FSM |Condition from the menu orCondition button in the toolbar,clicking the transition and typingthe condition expression.Pleaseaddthefollowingconditions: Start=‘0’ to the loop transition in theIdle state and to the transition fromthe Exec to the Idle state Start=‘1’ to the transition to the Execstatewww.aldec.com25Creating Fub Contents• Three kinds of actions can be specified for a state – entry, stateand exit actions. Use FSM | Action | State from the menu, clickinginside the state and typing the expression(s) that should beexecuted in the state.• Add the following action:•RST<=‘1’ to the Idle stateActions and transitionsexecuted in a hierarchicalstate are defined on aseparate state machinediagramwww.aldec.com26Creating Fub Contents• You can define the action of a hierarchical state by right clicking onhierarchical state and selecting the Push Hierarchy option.• A new state diagram••hierarchy sheet will becreated.
It starts with Entryand ends with Exit pointsThere can be an actiondefined between these twopointsFirst, add a second state andcreate transitions as shownon the rightwww.aldec.com27Creating Fub Contents• Change the first state name to Run• Change the second state name to Count• Please add the following condition: Start=‘1’ to the loop transition in the Countstate;• Add the following action: RST<=‘0’to the Run state Clock <= CLKto the Count state• The final state machine for hierarchical Exec state is shown in thepicturewww.aldec.com28Creating Fub Contents• Save your state diagram by pressing Ctrl+S or choosing the ‘Save’•••button on the toolbarRight-click on the Control.asf file in the Design Browser and selectthe Compile option.