Introduction to UML Transcript


Hi... I'm Ben Cooper, uml2hdl product manager, and I've created this screencast to give you some background on UML in case it's new to you, or if you'd just like a quick refresher.  It's all very simple, really.  Let's get started, and I'm sure you will agree...



UML is a standardized general-purpose modeling language that is based upon 13 different graphic diagrams. 


 

Executable UML is an extension of standard UML.  Executable UML models can be transformed into the code required to implement the model.  Executable UML utilizes only two UML diagrams, but these diagrams include enough detail so that they can be compiled directly into executable code.


 

Uml2hdl is an implementation of Executable UML that has been adapted to support programmable logic designs.  Uml2hdl models HDL designs using just two UML Diagrams, Object Diagrams and Statechart Diagrams.   UML Object diagrams are easy to understand and implement.  Statechart Diagrams are similar to many of the standard graphic state machine design tools.


 

Executable UML also requires an "action language" to specify associations, perform operations, and so forth.  Uml2hdl uses VHDL or Verilog, as the action language, so you don't have to learn another new language.  In fact, you only need to enter VHDL or Verilog expressions, and you can specify these with your mouse.  There is no need to worry about the arcane details of HDL syntax.
The uml2hdl code generator takes care of all of that...

 


 

Every uml2hdl document starts with an Object Diagram, which depicts UML Objects and their relationships.  Each UML Object is assigned a distinct name.  This name, followed by a colon and the object's class is displayed, centered and underlined, at the top of the UML Object symbol. 
Each UML Object has properties that specify it's required behavior.  These properties and their current value are enclosed in curly braces and appear beneath the name. 

A horizontal line follows the object's name and properties.  Standard UML would then list the object attributes and methods.  UML attributes are the variables maintained by object, and the methods, of course, are the functions used to update the attributes.  However, attributes and methods do not really correspond directly to HDL design concepts.  UML, however,  provides a mechanism, called Stereotypes, to extend standard UML for situations just like this.  UML Stereotypes allow specialized nomenclature to be introduced.  Stereotypes are enclosed in double arrow brackets.  Uml2hdl uses stereotypes of <<outputs>> and <<inputs>> as shown in the uml2hdl object symbol.  In Programmable Logic design the value of variables, or attributes, are accessed by reading them directly instead of through getter methods as is customary in standard object oriented software design. Therefore, in uml2hdl, stereotyped <<outputs>> replace the UML attributes.  Standard UML methods are used to modify the attributes, and include input variables or parameters, so UML methods are stereotyped as <<inputs>> in uml2hdl.

 


 

In UML Class diagrams UML Associations specify the interconnections between UML Classes.  For UML Object diagrams the term "Link" is used instead of association.  Executable UML calls for links to be specified in the implementation's "Action Language."   In uml2hdl the action language is the currently selected HDL, so links are specified in VHDL or Verilog.  Each UML Object input is required to have a link assigned to it.  The link is a standard HDL expression that can be a single UML Output, or can include additional outputs, operators, or constants.


 

Uml2hdl Objects can be instantiated by dragging from the palette of UML Classes provided with software, from imported HDL entities or modules, or from uml2hdl Statecharts.  In all cases the same basic UML symbol is used, so you should now be familiar with all of them.

 


 

UML Statecharts are used to model behavior when an existing UML Class does not provide the necessary functionality.  A statechart appears as an object on a umlObject diagram, and it has inputs and outputs, like any other UML Object.  However, the statechart editor allows you to describe your statechart using a pallete of standard symbols.  Statechart graphics are similar to other state machine tools, but there a a couple of new terms you need to be familiar with.


 

Statechart "actions" are expressions that change a statechart output.  In uml2hdl an action is a Verilog or VHDL statement that assigns the result of an expression to a statechart output.  Statechart outputs have a default value, which is assigned to the output when no action is enabled for this output. 
Statechart "guards" are boolean expressions which control whether a transition from one state to another is enabled.

 


 

In UML a state is represented by a rounded rectangle surrounding the state name.  A transition is a path from one state to another, and is displayed on a statechart by a line with an arrow pointing to the destination state.  The initial state is flagged by a solid circle, filled with green, that has a transition to the initial state.  At reset the initial state becomes the active state.

Guard Expressions are assigned in the Statechart Expression Editor.  A Guard expression can be assigned a value of "else", which indicates that this transition is enabled if no other transition is enabled.  Guards appear near the transition line, and are enclosed in square brackets. A transition can have the same start and ending state.  This is called a self-transition.
Actions can also be assigned to transitions. Whenever the transition guard condition is true, the action is enabled.  Transition actions appear after the Guard expression and are preceded by a forward slash character.  Transition actions result in Mealy or asynchronous outputs.

Actions can be assigned to States with three different modes, Entry, Do, and Exit.  In uml2hdl an Entry action is enabled for only the first clock cycle that the State is active.  A Do action is enabled for all of the clock cycles that the State is active, and the Exit action is only active before the last clock that the State is active.  Entry and Do actions result in Moore or synchronous outputs, but Exit actions result in asynchronous outputs.

 


 

Well that should cover all the UML that you need to know to get started with uml2hdl, so you should be ready for the other screencasts that cover the details of uml2hdl design.  I'll see you there...