صفحه 1:
Synthesis
وگو رگضي صاحب الزماني
صفحه 2:
Transformation of
an abstract
description into a
more detailed
description
* "+" operator is
transformed into a
gate netlist
+ “if (VEC_A =
VEC _B) then"
is realized as a
comparator which
controls a
Lol sigs" nol ans:
What is 93901
maarocel N
library مت
technalogy x
library
2
3
ل
ص
2
5
2
multiplexer
كه ساده (مثل 01۴ ,۸, مقایسه) به گيتهاي ۰
عملگرهاي پیچیده تر مثل
we Jas tool ul yal> slglus Sdepebdb: |] هسب مراجرى
Bs ۲
موه ۱۴۳۷۲۵
(Gate) VHDL code
2
صفحه 3:
Field Programmable Gate 7 7
Arrav (FPGA) 1
logic _] routing
blocks tracks
a8 8) \e oe
aoe fe ۶
#و#وركضي صاحب الز _ switches
70
صفحه 4:
74 * مزایا:
* کوتاه شدن پروسه ي طراحي.
* نوآوري بیشتر (پروسه ی طراحي به مراحل بالاتر رفتاري
منتقل مي شود) (تشابه با زبانهاي سطح بالا)
Debug + طرح بسیار
Lal يعتر.
see اجرا- کامپار برنامه
* مانند مانند سیکل برنامه 3 ae
eee cles
شبیه oa deal Ese ورودظرل.
> را
«تعييرات أن قرع تسيا انق ۳
صفحه 5:
Synthesizability
100 %
Tod C * Onlya subset of VHDL is
synthesizable
Tod * Different Tool rt
Tool A ‘ifferent Tools suppo:
different subsets
* 7
* arrays of integers?
0%
٠ clock edge detection?
* sensitivity list?
وگو رگضي صاحب الزماني
صفحه 6:
rocess (CLK)
egin
FCLK='1'then
Q<=D;
endif;
lend process;
sensitivity ist Supported sensitivity ist not supported
flip flop transparentlatch
وگو رگضي صاحب الزماني
صفحه 7:
Macrocells
٠ adder
* comparator
* Bus interface
Constraints
* speed
* area
* power
Optimizations
٠ boolean:
mathematic
* gate:
technological
وگو رگضي صاحب الزماني
macrocell
مود
‘constraints
technology
lorary
How to Do?
|
Boolean 10
gate netlist (aes 1
VHDL code
preprocessed
VHDL code
boolean equations
صفحه 8:
Non-functional requiremen
١
- Clock speed is generally a primary requirement.
- Usually expressed as a lower bound.
+ Design cycle and Timing Closure
* Size:
- Determines manufacturing cost.
- If your design doesn’t fit into one size FPGA,
you must use the next larger FPGA.
- For very large designs: multi-FPGAs.
* Power/energy:
- Power/Energy related to battery life and heat.
* May have more cost:
- More expensive packaging to dissipate heat.
- More extreme measures (e.g. cooling fans).
- Many digital systems are power- or energy-
limited.
a
رگضي صاحب الزماني
صفحه 9:
Mapping into an FPGA ~
* Must choose the FPGA:
- Capacity.
- Pinout/package type.
- Maximum speed.
وگو رگضي صاحب الزماني
صفحه 10:
با
7
Synthesis Process in Practi
awl YSoo usjlu ang: Sleojil&e باوجود ٠
بعد از سنتزء همة محدودیتها برآورده نشده
۲ = 5
a2.
yes
OK 99
no
ُضي صاحب الزماني
صفحه 11:
Path delay
* Combinational network delay i
measured over paths through
network.
* Can trace a causality chain
from inputs to worst-case
output.
وگو رگضي صاحب الزماني
صفحه 12:
Path delay example
5هطل د جر ا لهي
network > B | = ۱
graph a
seo 7
model b OO © و ۱
صفحه 13:
Critical path
° Critical path = path which
creates longest delay.
* Can trace transitions which
cause delays that are elements”
of the critical delay path.
وگو رگضي صاحب الزماني
صفحه 14:
Critical path through delay, me,
صفحه 15:
Delay Paths in a design
man
register2output
input2register
register2register
input2output لس
وگو رگضي صاحب الزماني
15
صفحه 16:
False paths
* Logic gates are not simple nodes—some
input changes don’t cause output
changes.
* A false path is a path which never
happens due to Boolean gate conditions
* False paths cause pessimistic delay
estimates.
وگو رگضي صاحب الزماني 16
صفحه 17:
Placement and delay
* Placement helps determine routi:
* Routing determines wire length.
* Wire length determines capacitive ۱
load.
وگو رگضي صاحب الزماني
صفحه 18:
delay
¢ N-bit adder: (optimal placement)
وگو رگضي صاحب الزماني
صفحه 19:
0
routing
رگضي صاحب الزماني
placement
صفحه 20:
«Adder has been distributed throughout the FP
۰1/0 pins have been spread around the chip.
صفحه 21:
routing
With delay constraints.
Better placement and ۸ 1
2
eT 5
* Better but far from optimal (less spread
out horizontally but spread out vertically)
۳ گضي صاحب الزماني
صفحه 22:
How to improve?
* Use macros (optimized),
* Put constraints on the
placement of objects,
¢ Hand place objects.
- Example: later.
وگو رگضي صاحب الزماني
صفحه 23:
Power Optimization
وگو رگضي صاحب الزماني
27
صفحه 24:
Power optimization
* Transitions cause power
consumption.
* Logic network design helps
control power consumption:
- minimizing capacitance;
- eliminating unnecessary glitches
وگو رگضي صاحب الزماني 24
صفحه 25:
Power optimization
* Leakage in more advanced
processes.
- Even when logic is idle.
- The only way: disconnect the power أ
supply from the logic when not needéq
for some time.
~ It generally takes a considerable peri
(larger than a clock period) to
reconnect power and let the circuits
stabilize.
وگو رگضي صاحب الزماني 25
صفحه 26:
Glitching example a 5
* Gate network:
آفگورگضي صاحب الزماني
2
صفحه 27:
Glitching example behavie
* NOR gate produces 0 output a
beginning and end:
- beginning: bottom input is 1;
- end: NAND output is 1;
Difference in delay between
application of primary inputs
and generation of new NAND
output causes glitch.
فسن ساحب الوماس
صفحه 28:
Adder Chain Glitching GS ki
7 وركضي صاحب الزماني bad
صفحه 29:
Explanation
* Unbalanced chain has signals
arriving at different times at
each adder.
* A glitch downstream propagat¢
all the way upstream.
¢ Balanced tree introduces
وگو رگضي صاحب الزماني
صفحه 30:
a: High
transition
probability h2
>
bad good
30 رگضي صاحب الزماني ae
صفحه 31:
low تسیب
* Reduce number of logic leve 139 8
آفگورگضي صاحب الزماني
صفحه 32:
Example (ALU)
¢ ALU output is not used for every cyclé
0 > If ALU inputs change, the energy i:
needlessly consumed
وگو رگضي صاحب الزماني 32
صفحه 33:
Example (ALU)
* Control Signal selects whether data is
allowed to pass the logic or the previous
value is held to avoid transitions.
Dat
۳ Control بن ابن اقرواس A
صفحه 34:
Layout for low power
* Place and route to minimize
capacitance of nodes with hig
glitching activity.
٠ Feed back wiring capacitanc@%
values to power analysis for
better estimates.
وگو رگضي صاحب الزماني
صفحه 35:
State assignment for low 2 3
power 5
٠١ Later
وگو رگضي صاحب الزماني
صفحه 36:
Case Study
16 x 16 multiplier example.
وگو رگضي صاحب الزماني
27
صفحه 37:
The FPGA design 52066552
¢ Xilinx ISE (Integrated Synthesis
Environment)
- Translation from HDL.
* (Synthesis, Translation)
- Logic synthesis.
* (Mapping)
- Placement and routing.
* (Place and Route)
- Configuration generation.
* (Program File Generation)
وگو رگضي صاحب الزماني 37
صفحه 38:
Design experiments
* Synthesize with no constraints.
* Synthesize with timing constraint.
- Tighten timing constraint.
¢ Synthesize with placement constraip
° Power:
- Many tools don’t allow us to directly
specify power consumption
>» > must rewrite our h/w description for bette:
power consumption characteristics.
38
صفحه 39:
model
۰ No timing or area constraints
* HDL model in terms of FPGA primitives,
٠ Example: “
X LOPE ۱۳90 0009 7) >
(1006۴ م0060
1006 9 )6060
([] 9 2066
([6] سس 9066
([9۲سمم.
وگو رگضي صاحب الزماني
39
صفحه 40:
Mapping report
Odour 4,066 6
Ovober oP vowed Olww: OGG nuh 608 0
bie: COS ouch 666 96 لصوام يلت وعدم سانا حت ساس(
Oni COO 0% تا لام موی مق طلست
وا یی چاه این سا اه بسشججاويت مت *@ee DOTEO bebw Por
۱ ® eps LOT: 600 چیه 4,06 ۸
OP ou . 9 0 100 یا و حطس
9 تم + سحت سب تس فجه لا
6 :1۵۵۰ ۱ مه سم ۳00 تمدق
Prk Drwory Draw: OF OP
۳
40
صفحه 41:
Static timing analysis report/
Protay rostrata: TS _POP = DOXOELOY FROO TIDEGRE
"P®OG" TO MIOEERP "PCOS" 68.980 قد ;
fod evrory),
Ountwuw ع بواط 90.96۶
After Mapping: > estimated delays (no
5 information about interconnects)! Wot. 04 a
صفحه 42:
paths نسم
Octe Gheet report:
Ol udkes deployed to cseroads (7)
۳ & Pad
mann nnn nnn nn ban nn nn nn nn سا سس سس
یوق Pad |Desicaton Pad] Deby |
ann nnn سا تست تست سس تست تست سب تست سا ساب
x<O> jp<o> ۱ 966
x<O> lp<ao> | ٩۵:76
x<O> lp<aa> | cae]
x<O> <49>م | ars]
فسن ساحب الوماس
43
صفحه 43:
600 006۶ < 906 ۳۵ :تسه بمب
۳۹۵۵ ۰۳۵ ۲۳6۵0۵۵۳ ۰۳۱۵۵۵66
كف 69,99
و .سس سوه داص (0 لدو ادمه ود 900096909
errs, O bold errors) جد (0)
,46 عا روا مهو(
* (vs 20.916 ns in mapping report)
Because of interconnect delays.
وگو رگضي صاحب الزماني
45
صفحه 44:
Timing constraint
* Use timing
constraint
e itar.
TIMESPEC Name: 7
وگو رگضي صاحب الزماني 46
صفحه 45:
report
OOXOELCY PROD. < ۲86۳9۴ :له پم(
MOEGRE "PBOG" TMOEGRE "PHO
: ۰۵ 0
Pad to
pad 7
6009969 رها ( ,للم سب errors detevied. (DO
pet errors, O bok errors)
Outwuw thy عء 90.06»
Hasn’t changed since this design has limited
opportunities for logic synthesis to change
delays by restructuring logic.
وگو رگضي صاحب الزماني 47
صفحه 46:
report
TS_POP = DOEXOEL®Y PROD :مه پم
"تاه" ۳۹۵۵ TIOEGRE "PCOG" TO
: م 66
COIOSOE tewe wxrihrzed, D tote errors deed. (VJ
مب errors, boll evrore)
Out dey + O1.00P ws.
Tools generally try to meet the delay goal as
closely as possible to minimize area.
وگو رگضي صاحب الزماني 48
صفحه 47:
Tighter timing constrain
* Tighten requirement to 25 ns.
* Post-place-route timing report:
Protay costa: TS_POP = DPXOELCY Es
(۳1066606 ۲۵۵۳ TO MOCGRE "
9 هه :
اسص سس بیجع حجري ست 00060000
ح عد (aq
vetup errors, O
رز »06 ها روا مهو(
وگو رگضي صاحب الزماني 5
صفحه 48:
Report on a violated path?
po) مد - مسسنمم) »6,166 تس
(۵۵) <0>ر وه
p<Q0> (PHO) یی
Cried: C9.000w
Det Poke Doky: 0.2 Ocw (Levels oF Lowes = SM)
Modify the logic and/or physical design to
improve the delay.
50
صفحه 49:
Power report
Power mower: We) Plo)
errs Owen 9.600: موه مه Helps us determine
whether we need
51
صفحه 50:
Improving area
۰ Floorplanner window:
- Floorplanner > View/edit placed
des
rectangles|
: mapped
componen|
ts to CLBs
* Green
52
صفحه 51:
Rat’s nest wiring
+ If you click on a component in the deign
hierarchy window, its rat’s nest is shown.
تمه هو همه و و
53
صفحه 52:
Routing editor view
al و
el =
Tare
* FPGA Editor > View/Edit Routed Design
صفحه 53:
Editing constraints
* Use constraints editor to place constraints:
- This tool allws you to constrain the placement of logic as well
as the assignment of chip 1/0s to ToBs (e.g useful for PCB
lesign)
a
مس سس ددص | 1 8
سرت 55
صفحه 54:
wile,
احب الز.
Le
#ضب
وش
صفحه 55:
Drag and drop constraints We
وگو رکضي صاحب الزماني
صفحه 56:
Change the shape of
constraints
وگو رکضي صاحب الزماني
صفحه 57:
* We place the rows of the multiplier one below the
other to create the row structure of the floorplan.
اني )59
صفحه 58:
صفحه 59:
New timing report
* After placement constraints: 2
16۵066 وه سای بت errors A
.لس "© 59۳ 5277215 O wht errors)
Ouxtvuw dehy & OF
* Compares to 31 ns for
unconstrained placement.
وگو رگضي صاحب الزماني
صفحه 60:
Hardware realisation
با
x
On|_Loxte (dO ol
XODPLO &
pont (D, ©, O, X : مس )سس ی اون O);
1 فى ok xpo_vevier(© shure
Bc A
©)
rand IP_OXOOPLE;
oP AP_OXOOPLE & 0 انیت
bows
provess (8, ©, ©,
بسا
P(X = "4000" ) thew
DL <=;
ebP (0 = "Od0A") thew
DL <= 0;
he
بن ع> ره
eed PS a
62 لع proven العامة ae cel 4
ag
صفحه 61:
8 و .وه
Sensitivity List
D, GOL) ,( سس
bests * If SEL is missing in the
sensitivity list, what will 1 ۳9
the behavior
(simulation) be? ;=< 1
BY اج
vend proves)
* Sensitivity list is usually ignored during
synthesis.
* Equivalent behavior of simulation model and
hardware
> + Allsignals which are read are entered into the
sensitivity list.
ده Complete if-statement for the synthesis"tf رضي صاحب ا
صفحه 62:
168;
What is the value of Z, * موسر
7 > ۳۲ 1 <10_طوجو0 0ت نسم
What hardware would * ههد 6۵ 0۳ مس
be generated during 0۵0000۳ مس
synthesis ?
100۵0 ۰
"SEL < 1 هنگام aS Latch
شفافاست
.(Transparent latch) *
هم احتمالاً ناخواسته است
هم در مدارهاي سنکرون LFF
بهترند چون قبل از پايداري مدار
از مقادیر سيگنالهاي مياني
7 نو ا ی مي کند. 64
صفحه 63:
man
bbrary “Id 1
wwe IOCO.On|_Linte_ (IOP oh
ext PLO® ts
port (D, OL: oi_slowirs
a nd otd_ddowe);
لس PLOW;
orchtcctay (DP PLOP ع
brats
و
تسیا
سمب «xa OLOCevet oxnd LUC";
ع> و 0:
ead proves;
:© لع
رگضي صاحب الزماني
4
Modeling of Flip-Flops
65
صفحه 64:
for Sheek دب
* سنتزکننده ها معمولاً لیست حساسیت را
نادیده مي گیرند.
°* همه ي ]ها را هم پشتيباني نمي کنند.
PES a یم
wae supported) ام ) (---_أجوص ساد ) 216106606۵
)توس لیلجت 2000 و لب امد
لیلجت توس لسوت سید
لیلجت 00/۵ و لب ماد or
ی للد
تن 66
صفحه 65:
کی یت for رت
R1C1WC_COCE ( rbck_stqad_ wave)
vbk_stgrd_ ence’ COCO vad chok_styra_xnve="'
thich_stgad _xene='0' vad obok_ stg سمج 6008601١
ox’ OTPBLE vod pbch_stqad_uxve="("' متسه اس
vad wot chok_stqrd_wawe'STRBLE جوم _ لمیر
0س اممو اماد
1 سر 0076.6 606 5
ale ed صاحب الزماني حامت ف روا سید بح کی
صفحه 66:
۰ In Std_Logic_1164
Ree PAOD 5G (ect UX owl slow)
ع ما و
سر
ما
tl RIGIDB_COBE(OK); سمب
ao;
eal process}
B (CLC eves مه ۲ 2
ce OLA bet uch") fr
سم
eed RIGIOG_COGE;
وگو رگضي صاحب الزماني 68
صفحه 67:
Gated Clock
* Designers avoid using gated clocks because
of problematic timing behavior of the
circuit (adds skew).
* Low power designs deliberately disable
clocks to reduce or eliminate power waste
by useless switching of transistors.
pro
مسا
ura wil ۲۱۵/۱۵ ۵۵ Do
1
DGATE}
# (OOOTE) ben
as; CLK
eal proves}
رگضي صاحب الزماني 69
4
صفحه 68:
شمارندة يك رقمي
For all signaGDich
receive an assignment
in clocked processes,
memory is synthesized.
COUNT: 4 FF *
(constrained *
integer)
Qnot used in *
clocked process.
اشکال: مکانیزم ۲۵50۲ هنكام
COUNT
Register Inference
10K ابا
:فك :0064 عبسل نم5 ver WEEE
0۰ رهم
|
۱
00۵۸ سس
00۳۵۸ ۱ 0 سای
©0 د © صم وس : 000001١ امد
bers
proces (OK)
مسا
md OL = °C tea مس FOL
F (COMO? >= 9) fea
© =< ۵۵00
rhe
COO <= COOMT +4;
won FY
ex
exe prowess}
@Q <= 00007;
:© اعم
70
صفحه 69:
* iffelsif - structure
* The last elsif has an
edge
* Noelse
* براي 560/26561 سنکرون
فقط 011 در لیست حساسیت|
قرار مي كيرد (مي توان با
wait until هم مدلسازي
كرد).
* اما براي آسنكرون فقط با
ليست حساسيت مي توان
مدلسازي كرد
* حتماً همة وروديهاي آسنكرو,
در ليست حساسيت وارد
شوند والا نتيجة شبيه سازي
:100 مارا
BBO .Onl_ Lore MOE + سس
ع DOVOO_PP بسر
ROP | kr older ۵۵ ,0 ۵ ) مص
a
vt ok dex
v);
ام 00۷00 00:
۵ 00۷۵0( 0 مات
سا
(LK, ROT, GOP) سم
۸)
act:
eb (OLUC ever rd OL = °C) te
ع> و 0:
بع لمم
ead proves;
صفحه 70:
Hardware realization
A B A ©
SEL
2
Hardware realization
68 A
SEE
ber
POO
:0 +۵ > رز
he
:0+0 > رز
بع ead
eel provesy OXODPLEG,
@XOOPLES:
proves (O@L0,0)
verte PDP : ba;
bey
POOL =" bea
2۵۵ = ©:
whe
POP = 0;
eal ©:
ع> رز 0 + POO;
wad proves PXOOPLES;
۰ Ouced
حور
یلو
فقط يك جمع
کننده نیاز
دارد.
اگر ٩1 دیرتر
عن رفع عدار
بالايي سریعتر
عمل مي كندة7
صفحه 71:
ره ۳ شاه پوس لوط امن موه ).۰
QUT2 <= ((INT+IN2)-+( INS + INA) )+ (INS + ING لابقا فا معا اس رای
۰ Ae ae description the joogest po yee vic Pve, to the ver desorpiod
Ute three addiica poeppurcs - soe ppieizaiod took ره
dong he descriptivd uzvorday to .جام ساصممت مجنف جك
73
صفحه 72:
Source Code Optimization 2 ۱
AP ove oP te topus arrives hier thon vhers, tt coa be choses Por WO t'9
fe LEY koplewecktion. AA
AP power ts رم له و 109 could be used Por the stycrad trot
Prequediy to the fePt roplewectuiva stave tf posses throug وه ون
poly poe udder.
QUT <= INT + IN2+ INS + IN + INS + INE
صفحه 73:
سنتز عملگرها
بسته به عملگر و عناصر کتابخانه اي (برحسب
گيتهاي استاندارد یا برحسب اه ها (یا
ماکروسلها در 6810)) ماجولي در اه
ایجاد مي شود.
این ماجولها برحسب سرعت يا مساحت بهینه
شده اند (که کاربر مشخص مي کند)
در بعضي سنتز کننده ها مي توان در كد
سس ا0ر1نهايي نوشت تا Wis سوه
لملاسا یا رربعن طم۳؟) انتخاب کند.
وگو رگضي صاحب الزماني 75
صفحه 74:
Example: Adder
BOO te ره
port (,@ :
v
a 8 8
vod BOO; Package with “+“functions
wwohiectre PRIM LOEMO of BOO te |] rey OLOOOR IY;
۵ ser OCDOOR_LV p_vwrthworte
L<=0+0;
cea OO) COD ss ل
erento); ۵) چم اجه 1 @ et (B,
1D: nt oikoxie_uectr (P shout ©) J;
rend DOL_OOO;
BRIM LOEMC vf 00۷ ۵۵ جات
Il cer chawed ;® + ع> رز
eed BRIPLOE MO;
Odbontages oP 0 rodge devlaratvs with tateyer pes!
1) Ourtay skouktion: chert Por "pul oP roo...”
16 b) Outaq svokess: vy F bt bus widk رگضي صاحب الزماني
صفحه 75:
IF Structure <-> CASE
Structure
Different descriptions may be synthesized
differenth
سس < 6000 م 0
۳ We 0
ebP (1 <0?) how OO? <= ©;
thea ۵ <<
OO” <= ©;
سا OO? <= 0;
00 > ۵: thes vers =>
p ۱ OO? <= 0;
= :سل
A
B OUT
IN
yea يلحم
IN 17 IN our
۸ eT
سنتزکننده ها ممکن است optimize
کنند.
افرگورگضي صاحب الزماني ۰
77
صفحه 76:
Variables in 0
Processes
* Registers are generated for all variables that might,
be read before they are updated
OOR_A: proveve(OLAK) OOR_@: provevs(CLKK)
rank: POOP : جرج varie POOP : steer;
berger beeper
B (Olver exnd OL مد( B (Orv axed OL = 'C!) hea
PEO = WOT * بج OOTPOT <= PEO + G;
OONPOT_W <= POOE + :ل POOP = WOOT * O;
OOPPON_D <= POOP +O; el PS
weed PS eed pr
ead provess O@R_(;
۵086:
* How many registers are generated?
78
صفحه 77:
۳۱,۵۳ ۲۵۲ 010016 0
* در بیشتر سنتز کننده ها اگر براي
آشكارسازي کلاك, ۵156 به کار برده
باشیم انجام نمي دهند (نمي دانند
جطور بايد ان را د).
010 سس
مسا
event onl OL") thew را0) ۶
:0 >
تس
:© ع> و
ل
سس اور
وگو رگضي صاحب الزماني
79
صفحه 78:
Don’t Care
* درشبیه سازها مقایسه با -* در شرطها عموماً
نتيجة :۳۸151 مي دهد (هیچگاه مقدار سیگنال <
“-” نمي شود):
اكر مثلاً 1000“ < ه2” شود شرط 118118 نمي شود.
بر مي توان از (52 ,560222]65)51 (در بكيج 232_5]0عتصتام) |
80
صفحه 79:
Synthesis Tips
sf itime y character 9 Real*
۴ فا
*محدود به estbench
81
صفحه 80:
Synthesis Tips
وگو رگضي صاحب الزماني
82
صفحه 81:
Finite State Machines and ‘, 3%
VHDL 4
* One- , two- or three-
processes
* State Coding
٠١ FSM Types
* Medvedev
* Moore
٠ Mealy
¢ Registered Output
وگو رگضي صاحب الزماني
صفحه 82:
State
Registers.
60 :
whoa GDPERD م جد XSBO_O1 tea
GDOVE <= OWWOLE ;
wha KOOP => F XSBO_OTPOP tea
wher GPOP => F XSBO_OTORD tou
۵۵۵ > 6100001١
vhers => GPONE <= GNORT ; مان
۵ ,0 سم :۵ ۵۵
مسا
tora ۵۵ +
6۱08 > ۵۳0۵
fara را نمی مسج )ما
vee ODPNE
زع اعم
0
ع لم
عاسم
exe coer |
pod B
eer process POD_PP |
84
صفحه 83:
۳۵۵ 0۵۵6۵: سس (OPONE , X)
معط
cee OPOTE tx
0 مد ۵0_01۵عر
0۵۱۵۱۵۵ > 0۵۵
RESET
و ۳
P لحم
۳۷۵۸۵ مان
START ns MIDDLE 52
Se / : ۵0۵۸ > ۵/۵/۸۵ 00
سییر 5
weal owe | 7
POO_LOBIO ; ۳ a8 سدسم لم
با PCO_E: process (LK, RBGEP)
P ROOOT=C tes
GPOVE <= GPORT ;
eb OL (Cevect cod OLUE'( tea
GPOTE <= OGXP_OPOTE ;
:2 لدم 5
ا لو
صفحه 84:
Structure and Readability
* Asynchronous combinatoric # synchronous storing N
elements
=> 2 processes
* Graphical FSM (without output equations) resembles,
one state process
=> 1 process
Simulation
٠ Error detection easier with two state processes di
access to intermediate signals.
=> 2 processes
Synthesis
2 state processes can lead to smaller generic net list
and therefore to better synthesis results
(depends on synthesizer but in general, it is closer to, 7 و
hardware) Ey
=> 2 processes
وگو رگضي صاحب الزماني
86
صفحه 85:
. ص0۵6 ۵۵4 ۱۳۱۵/۲۵ سید
OTOP );
piegred GNODD : ONONG_ TCE 5
OPORP -< " 00 " ۰] همین 5
OWOLe -< " 00"
OTOP > "dO"
OTORT > "@OOa" +] دوي لسر dePot
OWOLO > "Odo" نت
مومه << "000"
| P low (Ht oF otter)! # buy (if oP ottes) } => محص POO! ی 7
8
صفحه 86:
4
رگضي صاحب الزماني
(SPORT, OWOLE, © & ۱/۵۵ 0۳۵۳۱۵ بر
POP) ;
0۵۷۸۵ : ۵۳۵/۱۵ سیم
۰ ۲۵ سم
مان
۵۵۸۵ مان
مان
اه مان
إعص اع
صفحه 87:
Extension of Type
tae OPOPD_DVOE w (SPOR
oY);
paard OPDPG 1 GOPOVO_PVRO |
vw OPONO &
wher ODOR
wher DDOLE
مارد
واه مان چا مب جع 00000007 ات
۳
A سید لب - مها و) vitor
deve shtew) 16 << 90عم)
Oberg to poe hot roday => uccevessay hardware
oD ۵0-م) => (0 umevroray Ply Pops) پرضي صاحب الزما
صفحه 88:
مس م0 +
بلس oP سیون ۰
+ Oke PEO
+ Porebe cooks
نمی ۰
۰ تاه بوخ
wwhea deste oboe)
منم (( to otl_vexte_vevior ۵۳۳۵۳۵۱۳۷۵ منوا
©);
okand OPONG 1 GLOVO_PVCO |
OPORD | OPODE_MVPO سدم
eaemant DIDOLE | ODOHPO_MVOD
varwant OPOP ۵۷۵۵
>
>
pwr OTOP &
<كجا0) 0/1٠ مارد
۵۵ مسانن
مارد
مان whew
eed expe |
90
صفحه 89:
FSM: Medvedev
NEXT
State STATE ۲
Registers:
8 Dhe oie vevtor rewrwbler te ote veviors > =O
Ow مه
hterture RPL oP DEOOCOCO &
Tue Proveveer
orchterture RPL of OBOOCOCO &
7
سا
wth Lowe Ol م۱ و6 و6
0 سس امس
۱ 7
prowess (LK, REGO)
prove رن OTOTO)
— Dent Ortee Leste
rod proves OOO |
صفحه 90:
v Example (2-
-ocess)
caer OMBDE te
مان
و
kes DUDOLE => F (Pond 0( bog
OEXPEPOME <= OF
۳۹
wif ee
hea POP ع(ه مد ه) جح 0 ea
SMG Ay ات
Ce 5
8 ۳
هم
+ .ما :
ead provess OM 5 23
فک رس
(v1) <= ۵۵ الزماني Lo ل
x
ماك نسم
RESET
Medvede
MwA
سس
1001 11
لا STATE = Output
sublyps STATE TYPE is std_ulogic vestor(t downto 0),
coistan! START. : STATE TYPE = ‘00.
constant MIDDLE ° STATE_TYPE
penstant STDP STATELTYPE
RD 0۵006۵0۵0۵۵ امه
GOPHONE ۵۱۵۵۵۵۵۱۵۵ نود
LOVE |
PROOCT=1 ton
GPOPE <= ۵۵ :
eb تیان ليد مجح ارات tow
۵0 > 0۸
pol B
2 eal proces ROD;
صفحه 91:
وگو رگضي صاحب الزماني
Medvedev Example
Waveform
CE لشت
به ۱۱ LU UU
RESET 0
A 0 أ 0 [| ۱
8 1 |
¥ 0 م ام
2 0 ۳۹ dl
I STATE(1:0)|/00 00
(1) = ©POTE => Orde ای
93
صفحه 92:
FSM: Moore
NEXT pes,
STATE | Stato STATE / output
Registers Logie
Phe cup vevbr a Pucctou oF fer vite very!’ = P()
یه مب ۲
tw 0000۵ ی با ۷ ماس ty 000 تن 0۷ تعاس
۵۵0 رن سس ROD:
ی
i ssn OOPPOP: process (OPOMO) رس لو
م OOPPOW: process (e
Oulput bows — سا
ead process OOTPOT ; تعدبا درف 0) --
:۱00۵ ون
eed RL 5
صفحه 93:
Moore Example ها
ص poly ou her pred okie, لبط طجه Gree +
صر ءا عسي 97016 بو اه م3 5 en
aia. fs
ame A an
subype STATE TYPE i slog vector downto
constm START. Stare Tee 7
۳
Sonstant STOP STATE TYPE
vaee ODODE &
hea SMBRD => F (B oF @)=(0! bora
0۳۵/۱۵۵ > 0۵۵
wes DADOUE => # (B rd B)= fora
DEXPENENE <= GOO ;
eo
hes OTOP => B (P xx )
OEXPEMETE
و
۰ 000۵ عن ۲) ماه
۱۵۵ 0۵ نس
تست
bes
REG? preceee (CLE, RESETS beeps
> ۵۵۵ _ مد ۵۵2
۵
tora اجه مسرج زان یر
0۱۵۵۵ > ۵6و
ead
0" whe SPO ME=DKDOUB
or OMNBPE=SPOP eter O's
pod RPV 5
صفحه 94:
Moore Example Waveform.
7
> 51۸1600
ماسب سوه 3 chem verbo uh ODEN )1/1(
وگو رگضي صاحب الزماني
96
صفحه 95:
FSM: Mealy
os
NEXT, ۲ “3
STATE _ | state STATE output شا IZ
Registers oe 2
Provesses مس
و erchterture RPL of DEOLY
beets
— Onate ما “IPerewer wih Dent 1
bow
مسج
00
Ovi Loxte =
veal proces OD GA
eed RPL 5 ل
صفحه 96:
0001
۱۲۱۱۳۱۹۱۳۳۳ ۵۲۵۵ ۵۵
beet
vee ODODE &
uber OPORD =>
RESET 10101 a
whver DIDLLO =>
subtype STATE_TYPE is sic_uloge_vecter(1 dewnta 0),
constant START - STATE TYP!
constant MIDOLE — STATECTY®:
constant STOP STATE“TYP!
wher OPO =>
archtecnre RPL of OBO _PCOT
veo
exard OPODD DOEXPOPOVE : اوه رس
۵۵۷۵
cod RAT
صفحه 97:
Mealy Example (Another
RESET 1010"
ROO:
COO: +
-- یی با موی موجه مصطوو()
ved
subtype STATE_TYPE is sic_uloge_veeter(1 dewrta 0)
constant START - STATE TYP!
constant MIDOLE — STATECTY®:
constant STOP STATE“TYP!
ve 0
archtecnre RPL of OBO _PCOT des (OPOPO = OPORD card (D امن 4
5 vr (POND = OKDOL) or
exard OPODD DOEXPOPOVE : (©POPO = OPO xxl (D or )
GPTORE_MVPE ; eho ۲:
exal RD;
صفحه 98:
افو رکضي صاحب الزماني
0 ا
۲ ات را <2 لوا اس ماه(
Dot the "spies" oP ۷ vad L to مومت
صفحه 99:
Feed back Woop
Modeling Aspects
يك
+ tates hockuare (wo vexrbraicand oii Por (فجقج
+ Qore Punt y eddovkte ote Vetter,
Qoore & preferred bevase oP ae vpercioa
* ke oly depres oly ox tte vec.
% > cent naa inher ore kde bay be ore ول ناه متس
] wore Rexble, bu doager oP
+ Ophes
+ Oewevessary buy pate (waxkounn olock pertod)
+ Onwwbaratzral Peed buck bev
صفحه 100:
Output
Registers
Output
Registers
Output
Logie
Output
Logie
optional
STATE
Registered Output
vordey looy poke oad powbetood boy.
x
State
Registers
ik poe uddhiond سم سا
Otkow addioad plock period
صفحه 101:
Registered Output Exampl
(1)
۷ ۱
2 > ۸ 008: Zot;
OMhno
beng
rape ODODE &
hea OPORD =>
proves (SPODE, O, O)
RESET
10101۱۷ 8و ی
۷ 4 0۵248 00۳0
2 ۸0۳8:
۳
OOPOOT_ROO: provevs
® OL eve xd OK
۷ vA
Let;
wend Pj
ای (0۳۱۳) سم ام
0۵۰ ۵ 6۷ سای
: تک وه : ابر ۱۷ و
expr OPOPD, DOXPOEPOVE :
OPOPE_AVCO ;
صفحه 102:
Reg. Output Example
Waveform
> STATEC a)
Ore ohooh ported dehy bowers OTOP D ced mur coney.
put comes wit pooh ede revul on pulpal choad
0 ی ی — )O
صفحه 103:
-- choked ODODE proves
RO
her Crepe مرا
CoO:
OOTPOT: provess
(OOXPOPONO , 0, ©)
مسا
came DOXPOPOPE
uber OTORT
111۷ <= Anand B:
RESET: Ze ore:
ved proms OODPOT
carchteckre RPL oP ROO_MBOTE ©
تک لاه : ,۷ موه :
prep OPDPB, OOXPOPODE + OOTPOT_ROE: provess(CLM)
OPOPE_AVCO ; bees
# OL eve لعج OLUE'C tre
صاحب الزماني ۰ :۷۱ > ۷
عه ره
صفحه 104:
150
1
00
وگو رگضي صاحب الزماني
CTU LU
Reg. Output Example
Waveform
100 50
لبد 190۱
oS
Le]
1 8
(ممعتمرة حأ
02 واه تج لجن 9۳۵۲۵ چنیا رولك
“Ophes" oP origad Oedy wackke ore yor!
صفحه 105:
* دستگاههاي روي باس با اعلان ۲۳5
mem buffer (F3) sid 7 دسترسي به
جب باس را آغاز مي كنند.
رگضي صاحب الزماني
صفحه 106:
۳۲۸0 1۷۲۲۲ - يك سيكل بعد, ٠
مي شود تا بگوید که يك خواندن "1
مي خواهد انجام شود (یا "0" برای_ ور
i نوشتن).
رگضي صاحب الزماني
صفحه 107:
*براي خواندن ممکن است 4کلمه
a0 42 ub tub (burst read) sl
اولین سیکل, burst فعال باشد. ور
9
و
رگضي صاحب الزماني
صفحه 108:
*کنترلر به 4 محل از بافر دسترسي مي
يابد (به محلهاي بعدي بعد از فعال
كردنهاي متوالي ۲6۵0۲ دسترسي ميال
هم
رگضي صاحب الزماني
صفحه 109:
y> mem_buffer طول خواندن
وگورکضي صاحب الزماني فعال مي کند و دو بایت پایین
bursk illo: 6 1: .gegal اف ايه
صفحه 110:
(pial A صاحت الزماني
صفحه 111:
*هنگام نوشتن ۵ فعال مي
7 شود و 121 در محل007655ه
ف * خواند تو شتورهون فاطعلان 2620 خاتمه مي
1 ٍ
رگضي صاحب الزماني
صفحه 112:
ready
ready ready
ready burst
7۳
Read_wy kRead_wri
te 5 read
ready
burs! ready,
وگو رگضي صاحب الزماني
صفحه 113:
Memory Controller
* براي همة حالتها مفروض اسک*
وگو رگضي صاحب الزماني
صفحه 114:
library ieee;
use ieee.std_logic_1164.all;
entity memory controller is port (
reset, read_write, ready,
burst, clk : in std_logic;
bus id : in std logic_vector(7 downto 0);
oe, we : out std logic;
addr : out std_logic_vector(1 downto 0));
end memory controller;
architecture state_machine of memory controller is
type StateType is (idle, decision, read1, read2, read3,
read4, write);
signal present state, next state : StateType;
وگو رگضي صاحب الزماني
صفحه 115:
VHDL Code
begin
state_comb:process(reset, bus id, present state, burst,
read_write, ready) begin
if (reset = '1') then
u_%Don’t cares assigned to
next state e=idle; اه
else
case present state is
when idle => oe <= '0'; we <= '0'; addr <=
"00";
if (bus_id = "11110011" and ready = ‘1’) then
next_state <= decision;
else
next_state <= idle;
end if;
when decision=> oe <=
"00";
if (read_write = '1') then
else outgadtsyotberidse, unwanted latches.
next_state <= write; صاحب الزماني
end if:
صفحه 116:
صاحب الزماني
0 addr <=
‘0'; addr <=
whenreadl => oe <='1'; we <=
“00";
if (ready = '0') then
next_state <= read1;
elsif (burst = ‘0') then
next_state <= idle;
else
next_state <= read2;
end if;
when read2 => oe <=
"01
if (ready = '1') then
next_state <= read3;
else
next_state <= read2;
end if;
when read3 => oe <='l'; we <=
"10";
if (ready = '1') then
next state <= read4;
else
next state <= read3;
صفحه 117:
VHDL Code
; we <= '0'; addr <=
when read4 => oe <='
end process state_comb; صاحب الزماني
a1
if (ready = '1') then
next state <= idle;
else
next state <= read4;
end if;
when write =>
"00";
if (ready = '1') then
next. state <= idle;
else
next _state <= write;
end if
end case;
end if;
صفحه 118:
VHDL Code
state clocked:process(clk) begin
if rising edge(clk) then
present state <= next state;
end if;
end process state_clocked;
end;
وگو رگضي صاحب الزماني
صفحه 119:
تولید خروجیها در ماشينهاي 1۷۲0076
1) خروجيهايي که از بيتهاي حالت به طور
1 قبل)
A وركئضي صاحب بیررارآسانتر
صفحه 120:
مر ولید خروجیها در ماشينهاي ۷۲0076[
2) خروجيهايي که از رجيسترهاي خروجي به طور
Inputs
State
¢ Registers ——_
۵ " انتساب به خروجیها باید در خارج ازپروسسي که انتقال حالات در
وگن تعاریف ازمطیشود انجام گیرد. 7
2
صفحه 121:
architecture state_machine of memory_controller is
type StateType is (idle, decision, read1, read2,
read3, read4, write);
signal present_state, next_state : StateType;
signal addr_d: std_logic_vector(1 downto 0); =
D-input to addr f-flops
begin
state_comb:process(bus_id, present_state, burst,
read_write, ready) begin
case present_state is -- addr outputs
not defined
when idle <7 'Q;we<= "0; =
addr is absent. قرض؛ فقط برای "ده آین کار را ۰
ملفه او ری ی 9 < 14 عناط) عز
زماني ند
next_state <= decision; ‘7
else
next_state <= idle;
end if;
when decision=> oe <= '0'; we <= '0';
if (read_write = '1') then
next_state <= read1;
else --read_write
next state write:
1 gale fll صاحب
صفحه 122:
when read1 => oe <=
if (ready = ‘0') then
next_state <= read1;
elsif (burst = '0') then
next_state <= idle;
else
next_state <= read2;
end if;
when read2
if (ready = ‘1') then
next_state <= read3;
else
next_state <= read2;
end if;
when read3
if (ready = '1') then
next_state <= read4;
else
next_state <= read3;
end if;
‘we <=
we <=
oe <=
oe <=
وگو رکضي صاحب الزماني
صفحه 123:
when read4. => oe <=
if (ready = '1') then
next state <= idle;
else
next state <= read4;
end if;
when write => oe <=
if (ready = ‘1') then
next. state <= idle;
else
next_state <= write;
end if;
end case;
end process state_comb;
with next_state select -- D-input to addr flip-
flops
addr_d <= "01" when read2, -- defined here.
"10" when read3,
"11" when read4,
"00" when others;
یو رگضي صاحب الزماني
صفحه 124:
state_clocked:process(clk, reset) begin
if reset = '1' then
present state <= idle;
addr <= "00"; -- asynchronous reset for addr
flops
elsif rising edge(clk) then
present_state <= next state;
addr <= addr ) ~- value of addr_d stored in
addr
end if;
end process state clocked;
end state_machine;
وگو رگضي صاحب الزماني
صفحه 125:
#4 تولید خروجیها در ماشینهای 1۷۲0016
7 *مشکلات: 5
2 ۲۳ اضافه.
*براي انتشار بيتهاي حالت به ۳۴هاي ۵00۲, از دو
مدار تركيبي رد مي شود (اگر در ۳1 از 2 سلول
استفاده کند مي تواند فرکانس ماکزیمم را محدود
صفحه 126:
1 ۸ تولید خروجیها در ماشينهاي Moore
9 3( خروجيهايي که مستقیماً در بيتهاي حالت انکد
شده اند lev)
»1L, State encoding ٠ بم دقتلنجام
شود.
٠ 2 #هايبيشترولا_زم دارد.
رسي صاب النوإي خروجي به مدار تركيبي نياز ندارد 2[
oy ۳ 7
صفحه 127:
51
rl ol ol oO] BR] of o
s2
ه اد ۵۱ ۵ | ه | ه | سر
Idle
decisio
n
Read1
Read2
Read3
Read4
Write
State Encoding
Addr(1
)
0
0
ه |ه اد | |ه
* فرض: فقط براي 2007 این کار را انجام مي دهیم (براي we
و 06 مشکل زماني نداریم)
Addr(O
)
0
0
S| RF) of Rio
صفحه 128:
State Encoding
* اگر براي ۵ و 06 هم بخواهیم به همین صورت 000006
کنیم:
Addr(0 | Addr(1 we ۱0۵ 0
) ) o 0 0
0 0 Idle
0 0 1
0 0 decisio
n 0 1 0
0 0 Read1 | 1 0
3 0 86802 0 1 0
0 1 Read3 | 1 0
1 1 Read4 |; 0 0 :
0 0 Write برئضي صاحب آلزماتي
on
صفحه 129:
VHDL Code
architecture state_machine of memory controller is
-- state signal is a std_logic vector rather than an
enumeration type
signal state : std_logic_vector(4 downto 0);
constant idle: std_logic vector(4 downto 0) :
constant decision: std_logic_vector(4 downto 0
"00001";
constant read1_ : std_logic_vector(4 downto 0)
constant read2_ : std_logic vector(4 downto 0)
constant read3_ : std_logic vector(4 downto 0)
constant read4_ : std logic vector(4 downto 0)
constant write : std_logic vector(4 downto 0)
begin
state_tr:process(reset, clk)
begin One-process FSM
if reset = '1' then
state <= idle;
elsif rising _edge(clk) then
case state is ~- outputs not defined here
when idle =>
if (bus _id = "11110011") then صاحب الزماني
صفحه 130:
VHDL Code
when decision=>
if (read_write = '1') then
state <= read:
else ~-read_write=
state <= write;
end if;
when read1
state <= read1;
elsif (burst = '0') then
state <= idle;
else
state <= read2;
end if;
when read2 =>
if (ready = '1') then
state <= read3;
end if; -- no else; implicit memory
وگو رگضي صاحب الزماني
صفحه 131:
when read3. =>
1') then
read4;
-- no else; implicit memory
when read4 =>
if (ready
state <=
end if;
when write
if (ready
state <=
end if;
when others
state <=
end case;
end if;
end process state tr;
-- outputs associated with register values
we <= state(1);
oe <= state(2);
addr <= state(4 downto 3);
end state_machine; صاحب الزماني
صفحه 132:
State
Stated
State
ثال: يى State2
با 2
Stated
StateS
State
State7
States.
Stated
رگضي صاحب الزماني State10
One-Hot Encoding
Sequential
‘00000
0001
00010
001i
00100
0101
00110
oon
01000
1001
(01010
One-Hot
22 0
0001
22 0 0
0010
22 022 50
0100
0000000000000
1000
22 1
0000
22 5 020
0000
0000000000100
0000
0000000001000
0000
0000000010000
0000
0000000100000
0000
0000001000000
0000
صفحه 133:
One-Hot Encoding
وگو رگضي صاحب الزماني
صفحه 134:
stateO
statel
state2
S,8;5:8:S,(53l>
00010
01111
10001
cond,cond,cond,
أوكر كوك وكيه
(بعدي
01111
01111
01111
13
6
صفحه 135:
Sequential (
Encoding
5,602 5 رد ,5 يد +... +0110©.
48 رگ ,5 رگ +... +63 010 .رک گرگ رگ رک +... +0101 .رگ رگ رگ رک +... - و(
Dy §,5,5,55,.cond+...+ §,5,555,.COnB+...+ §,8,5,55.cond=
Dg, =..+ 55,55, §.Cond + ...+ §,5,5,55,.CONG+ ...+ رک رگ رک 5 3 0
گضي صاحب الزماني > مدار تركيبي بسیار
7 5-3
صفحه 136:
One-Hot Encoding
£,=b.cond+ t,,.con@+ t,,.cond
* مدار تركيبي بسیار ساده
* اما تعداد obj LFF
8 معادلة بسیار ساده به جاي 5 معادلة
aie,
سطوح كمتر مدار بين ر. > ©
حالت
فرکانس بالاتر > <
۰۲۳0۸ *مناسب براي
وگو رگضي صاحب الزماني
22221010100
222211010100
o10
‘0000000000000
100
‘0000000000001
‘000000000000010
‘0000000000010
00
‘0000000000100
00
‘0000000001000
‘0000000010000
‘0000000100000
00
1000000010000000
000
om
صفحه 137:
Power Reduction
25510212621 51216 مناسبمي تولند توان
مصرفي را کاهشدهد.
۰ مثلاً 06-01 در هر سیکل, فقط 2 تغییر سیگنال
لازم دارد.
٠ عوامل دیگر:
٠ تعداد زيادي رجیستر مي خواهد
٠ء مدار منطقي تولید حالت بعدي
> بايد آزمايش كرد.
مرئضي صاحب الزمانبوجن0 1۳00 ز۳۵): براي]1٩۳هايشبيم eile
a: دا من فد
صفحه 138:
Pipelining
چند سیکل انجام مي شوند تقسیم کنیم:
721 *ایدة اصلي: عملیات 12120210 بزرگي را که در یک
سیکل ساعت انجام مي شود به چند عمل کوچک که در
۳ 2
2 $| outputs
3 a
ale ale
on
t=
x
2 2 عسميم إلا د
3
zh ۳ Ze ale
t,= x/3 t,= x/3 t,= x/3
Inputs}
Input:
inputs|
صفحه 139:
Pipelining
74 ۰ تقریباً 3 برابر مشود (صرفنظر از زمانهایی,؟ و ,با
برايرجيسترهاي(6<ذاءمرذم
throughput 3° برابر ميشود اما خروجيها 3 كلاكديرتر
حاضر ميشوند: latency
*و نیز هزينة افزودن رجیسترها را دارد.
*بیشتر ۳0۸]ها مشكلي ندارند اما در ]۳ ها
»ستاعمام كمتر به كار مي رود.
array jl passS. > &CPLD* »1و10, عملیاتزیادیرا
میتولنند لنجام دهند
صفحه 140:
cu tenet
ec src_op
۳ 7
صفحه 141:
AMD AM2901
library ieee;
use ieee.std_logic_1164.all;
use work.numeric_std.all;
use work.am2901_comps.all;
entity am2901 is port(
clk, rst: in std_logic;
a,b: in unsigned(3 downto 0(( -- address.
inputs
d: in unsigned(3 downto 0); _—_-- direct data
i: im std_logic_vector(8 downto 0); -- micro
instruction
cm: — in std_logi - carry in
oe: in std logic; output enable
ram0, ram3: inout std_logic; -- shift lines to
ram
qs0, qs3:_inout std_logic; -- shift lines to q
y: buffer unsigned(3 downto 0); -- data outputs
(3-state)
g_bar,p_bar:buffer std_logic; -- carry generate,
propagate
buffer std_logic; -- overflow
buffer std_logic; -- carryout ماني
buffer std_logic; =0
صفحه 142:
architecture am2901 of am2901 is
alias dest_ctl: std_logic_vector(2 downto 0) is i(8 downto 6);
alias alu_ctl: std_logic_vector(2 downto 0) is i(5 downto 3);
alias src_ctl: std_logic_vector(2 downto 0) is i(2 downto 0);
signal ad, bd: unsigned(3 downto 0);
signal gq: — unsigned(3 downto 0);
signal r, s: unsigned(3 downto 0);
signal alu_out: — unsigned(3 downto 0);
begin
-- instantiate and connect components
ul: ram_regs port map(clk => clk, rst =:
alu_out => alu_out,
dest_ctl => dest_ctl, ram0 => ram0, ram3 => ram3,
ad => ad, bd => bd);
u2: q_reg port map(clk => clk, rst => rst, alu_out =
dest_ctl => dest_ctl,
alu_out,
qs0 => qs0, qs3 => qs3, q => ركو
u3: sre_op port map(d => d, ad => ad, bd => bd, q => q,
src_ctl => src_ctl, r => 1,8 => 5);
u4: alu port map(r => 1, s => s, cn => c_n, alu_ctl => alu_ctl,
alu_out => alu_out, g bar => g bar, p bar => p_bar,
c_nd => c_n4, ovr => ovr);
u5: out_mux port map(ad => ad, alu_out => alu_out, dest_ctl =>
dest_cti,
0e, y => y); >= وه
--define f_0 and £3 outputs cas
£0 <= '0' when alu_out = "0000" else مضیا صاحب الزماني
Pea
صفحه 143:
7 آ 00
۲ 1 1
oP وجبها
roa fea
ارگ رگضي صاحب الزه
ye
صفحه 144:
library ieee;
use ieee.std_logic_1164.all;
use work.numeric_std.all;
use work.am2901_comps.all;
entity am2901 is port(
clk, rst: in std_logic;
a,b: in unsigned(3 downto 0(( -- address.
inputs
d: in unsigned(3 downto 0); _—_-- direct data
i: im std_logic_vector(8 downto 0); -- micro
instruction
cm: — in std_logi - carry in
oe: in std logic; output enable
ram0, ram3: inout std_logic; -- shift lines to
ram
qs0, qs3:_inout std_logic; -- shift lines to q
y: buffer unsigned(3 downto 0); -- data outputs
(3-state)
g_bar_q,p_bar_q:buffer std_logic; -- carry
generate, propagate
buffer std_logic; -- overflow
'q: — buffer std_logic; -- carry out ماني
buffer std_logic; -- alu_out = 0
صفحه 145:
architecture am2901 of am2901 is
alias dest_ctl: std_logic_vector(2 downto 0) is i(8 downto 6);
i ctl: std logic vector(2 downto 0) is i(5 downto 3);
alias sre_ctl: std_logic_vector(2 downto 0) is i(2 downto 0);
signal ad, bd: _unsigned(3 downto 0);
signal q:' unsigned(3 downto 0);
signal r,s: unsigned(3 downto 0);
signal alu_out, alu_out_q: — unsigned(3 downto 0);
begin
-- instantiate and connect components
ul: ram_regs port map(clk => clk, rst =
alu_out => alu_out_q,
dest_cfl => dest_ctl, ram0 => ram0, ram3 => ram3,
ad => ad, bd => bd);
u2: q_reg port map(clk => clk, rst => rst, alu_out => alu_out
dest_ctl => dest ctl,
qs0 => qs0, qs3 => qs3, q => q);
u3: sre_op port map(d => d, ad =>'ad, bd => bd, a => q,
sre_ctl => sre ctl, r => 1, 5 => 5);
u4: alu port map(r => r,s => s, cn => ¢ n, alu ctl => alu_ctl,
alu_out => alu_out, g bar => g_bar, p_bar => p_bar,
end => ¢ nd, ovr => ovr)
u5: out_mux port map(ad => ad, alu_out => alu_out, dest_ctl =>
dest_ctI,
oe => 0e, y => y);
rst, a => a,b =>b,
--define f_0 and £3 outputs
£0 <= '0' when alu_out _q = "0000" else '
£3 <= alu_out _q(3); صاحب الزماني
No change
صفحه 146:
process (clk)
if (rising_edge(clk) then
alu_out_q <= alu_out;
صفحه 147:
References
* Wayne Wolf, FPGA-Based System
Design, Prentice Hall, 2004.
* Ulrich Heinkel, Martin Padeffke,
Werner Haas, Thomas Buerner,
Herbert Braisz, Thomas Gentner,
Alexander Grassmann, The VHDL
Reference: A Practical Guide to
Computer-Aided Integrated Circuit
Design including VHDL-AMS , John
Wiley & Sons, 2000.
وگو رگضي صاحب الزماني