


























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



























List of attributes
-style interconnect
-^ Data types in VHDL are, by default, un
resolved
-^ Data types are resolved only when a resolution function is included aspart of their declaration^ –^ Such a function specifies for all
-^ Std_logic and std_logic_vector are resolved types –^ Std_ulogic and std_ulogic_vector are corresponding un-resolved types –^ Both types are drop-in replacements for the defaults “bit” and “bit_vector” library ieee;use ieee.std_logic_1164.all
;
if^ my_signal
my_signal
=^ ‘1’^ then
-^ statement
can be one or more sequential statements
imply priority
catches any cases not described earlier
phrase is optional (brackets not used) [loop_name:] while
condition loop statementsend loop^ [loop_name]
;
phrase is optional (brackets not used)
-^ conditional loop exit optional [loop_name:] loop^ statements[exit^ when
condition_expr;] end^ loop
[loop_name]
;
of^ bus_test^ is constant^ MYADDR
:^ std_logic_vector
23 downto^12
signal^ RDYOE^
:^ std_logic;^
--^ tri-state^ control
signal^ for^ RDY
signal^ RDYVAL:
std_logic;^
--^ value^ for^ RDY
when^ enabled
type^ state^ is^
(Idle,^ DoIt,^ Fini);
--^ define^
FSM^ states
signal^ mystate
:^ state;^
--^ instantiate
our^ state^ variable
process^ (reset,
--^ use^ process
for^ sequential
synthesis
begin^ if^ reset=‘0’
then^
--^ this^ is^ an^
asynchronous^ reset
mystate^ <= Idle;
--^ initialize^
the^ FSM^ state
RDYOE^ <=‘0’;^
--^ tri-state^ RDY RDYVAL<=‘0’;^
--^ be^ ready^ for
enable^ later
elsif^ H1’event
and^ H1=‘0’^ then
--^ trailing
edge^ trigger
case^ mystate^ is^ when^ Idle^ =>if^ STRB=‘0’
and^ RW=‘1’^ and
addr=MYADDR^ then mystate^ <=^ DoIt;
--^ also^
do^ any^ needed^
READ^ action^ here
RDYOE^ <=^ ‘0’;^
else^ mystate^ <=^
Idle;^ --^
stay^ in^ Idle^
state RDYOE^ <=^ ‘0’;^
end^ if;
-^ A case^ statement generates a multiplexer –^ An if^ – then - else^ generates a priority encoder or mux -^ Comparison operators infer an identity or magnitude comparator^ •^ Identity comparisons are much
more efficient than magnitude comparators
-^ Try to imagine the hardware that corresponds to each piece of code •^ Build your design according to a mental (or actual) block diagram •^ Remember, ‘Z’ is usually not a value that synthesis can assign to a flip-flop! •^ Do not specify initial values in your signal declarations^ –^ Most synthesis systems ignore these^ –^ Instead, always initialize everything under an explicit reset