基于FPGA的位CPU設(shè)計(jì)_第1頁(yè)
基于FPGA的位CPU設(shè)計(jì)_第2頁(yè)
基于FPGA的位CPU設(shè)計(jì)_第3頁(yè)
基于FPGA的位CPU設(shè)計(jì)_第4頁(yè)
基于FPGA的位CPU設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩41頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

基于FPGA的16位CPU設(shè)計(jì)11.1

KX9016的結(jié)構(gòu)與特色11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.1 單步節(jié)拍發(fā)生模塊11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.2 運(yùn)算器use

IEEE.std_logic_ll64.ell;use

IEEE.srd_logic_unsigned.x

ll;enrity

ALU_V

isport(

e,

b

.

in

std_logic_vecror(lS

downro

0)

;sel

.

in

std_logic

_vecror(3

downto

0);c

.

our

srd_logic_vector(lS

downto

0));endALU_V;architecture

rtl

of

ALU_V

isconstantconstantconstantconstantconstantconstsmtconstsmrconstantconstantconstantbeginelupess

:

std_logic

_vector(3

downto

0)

.=

"0000“,smd0p

.

std_logic_vector(3

downto

0)

:=

"0001",or0p

.

std_logic_vector(

3

dbwnto

0)

:=

“0010“;not0p

.

std_logic_vector(3

downto

0)

:=

"0011",xor0p

.

std_logic_vector(3

downto

0)

.=

"0100";plus

.

std_logic_vector(3

downro

0)

.=

“0101“;sd

usub

:std_logic_vector(3

downro

0)

:=

"0110";inc

:

std_logic_vector(3

downto

0)

:=

"0lll";dec

:

std_logic_vector(3

downto

0)

:=

"1000";zero

:

std_logic_vector(

3

downro

0)

:=

“1001“;process(e,

b,

sel)cese

sel

isbeginwhen

plus

=

>?=

e

t

b

;

--EQUIV?=

e

-

b

; --

)c

?=

e

t

"0000000000000001"c

?=

e

-"0000000000000001"c

<

=

“0000000000000000"

;whenwhenwhenwhenwhenelusubirm

=?dec

=?zero

=>;

--#0l;

--

l

Q-- ? 0--orhers

=>

c

<=

“0000000000000000"

,end

rtl;11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.3 比較器library

IEEE:use

IEEE.std_logic_ll64

.ell:use

IEEE.std

_logic

_erith.ell:use

IEEE.std_logic_unsigned.ell:entity

coep

isport(

a,

b:

in

std_logic

_vector(l5downto

0);{

2

downto

0

):sel

:

in

std_logic_vectorcoepout

:

out

std_logic):end

coep:architecture

rtl

of

cozp

isbeginprocess(e,

b,

sel)begincese

selwhen

eqwhen

neqwhen

gtwhen

gtewhenwhenwhen=>

if

e=

b

then

coapout<='l';=>

if

e/=

b=>

if

a

>b=>

if

e>=bif e<bif

e<=

belse

coipout<

=

'

0':elsecoipout<='0':elsecoipout<='0';elsecoipout<='0';else

coipout<

=

'

0':end

if:end

if:end

if;end

if;end

if:end

if:thenthenthenthencoepout<='l':coipout<='l';coepout<='l';coapout<='l':lt

=>lte

=>thencoepout<='l':

elsecoipout<='0':others

=>

coipout<

=

'

0'

;end

cese:end

process:end

rtl;constanteq:std_logic_vector(2

downto0):=“000“:constantneq:std_logi

c_vector(2

downto0):=“001“;constantgt:std_logic

_vector(2

downto0):=“010“:constantgte:std_logic

_vector(2

downto0):=“011“:constantlt:std_logic_vector(2

downto0):=“100“:constantlte:std_logic

_vector(2

downto0):=“101“;11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.4 基本寄存器與寄存器陣列組1.基本寄存器11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.4 基本寄存器與寄存器陣列組1.基本寄存器11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.4 基本寄存器與寄存器陣列組1.基本寄存器11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.4 基本寄存器與寄存器陣列組1.基本寄存器11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.4 基本寄存器與寄存器陣列組1.基本寄存器11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.4 基本寄存器與寄存器陣列組2.寄存器陣列11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.4 基本寄存器與寄存器陣列組2.寄存器陣列11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.4 基本寄存器與寄存器陣列組2.寄存器陣列11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.5

移位器11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.5

移位器11.2

KX9016基本硬件系統(tǒng)設(shè)計(jì)11.2.6

程序與數(shù)據(jù)存儲(chǔ)器11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)11.3.1

指令格式(1)單字指令。11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)11.3.1

指令格式(2)雙字指令。11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)11.3.2

指令操作碼11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)11.3.2

指令操作碼11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)11.3.3

軟件程序設(shè)計(jì)實(shí)例11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)11.3.3

軟件程序設(shè)計(jì)實(shí)例11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)11.3.4 KX9016v1控制器設(shè)計(jì)1、程序結(jié)構(gòu)2、指令的語(yǔ)句結(jié)構(gòu)end

CONTRLA;conetentconetentconetentconetent?o:;M:[shftpess:

STD_L

OGIC_VECT

OR(2

DOWNTO

0)

:=

"000";

--elupesszeroinc:

STD_L

OGIC_VECT

OR(3

DOWNTO

0)

:=

"0000";--ALUMS:

STD_L

OGIC_VECT

OR(3

DOWNTO:

S

TD_L

OGIC_VECT

OR(3

DOWNTO0)

:=

"1001";--0)

:=

“0111“;--$91’= ”0101”,-- -

+ #$6l

"

STD_[CJ

G!(_VE(TG

R]DO\Y

NTG0)type

etete

is

(resetl,

reset2,

reset3,

execute,

nop,

loed,

store,loed2,

loed3,

loed4,

store2,

store3,

store4,

incPc,

incPc2,

incPc3,loedI2,

loedI3,

loedI4,

loedI5,

loedl6,

inc2,

inc3

,inc4,

move1,

move2?add2,

add3,

add4)

;eignel

cu

rrent_stete,begin.w s K B .w

B

m7G

?next_stete :

etete;

--

Q.o

lly.o

t.o

±sCOM:

process(

current

etete,

instrReg,

compout)begin

--FloydprogC

ntrRd<=’0’;

eddrRegWr<=’0’;

eddrRegRd<=’

0’;out:ReqWr

+=

'0

'

;

o

at:Req

Rd

+=

'0

'

;

eh:i

II:8

e

1+=

eh

II:p

a

e

e

;

a

1

ii3

e

1+=

a

let

p

a

e

e

;

opReqRd

<=

'0

'

;

o

p

ReqW

r

+=

'0

'

;

iri

e

UrW

rd=

'0

'

;

r

eg8

e

1+=

”0

0

0

;r

eg

Rd

<=

'0

'

;

r

eqW

rd=

'0

'

;c

a

e

e

com

r

end

ct:

a

be

iehnuoou

Rh 2 ou

R Rdrw+=

'

0

'

;

van

a

<=

'0

'

;;ip;n

x2p

r

o

C

rn

x

r

3dd

R

reset3=

>

vme

<=’1’;execute=

>r

<whenwhenrw<=’0’;

instrWr<=’1’;

next

stete<=

execute;ceee

instrReg(15

downto

11)

is--mt]z

,3when

"00000"next_steteincPc;-- NOP

a#when

“00001“next

eteteloed2;

--

LD

/stwhen"00100"

=>progcntrRd <=<= shftpess;’1’;

elusel

<=

inc

;shiftselnext_stete

<=

loedI2;

--LDR

st<=

inc2;

--

INC

st<-

add2;

-- 9’

9

ADD

st<=whenwhenwhenwhen“00111““01101“"00011"=>

next_stete->

next_

etate=>

next_stetemovel;--

M

OVE

/e

t-- PC

/91others

=

>next_stete

<

=

incPc;end

ceee;loed2=>whenreg

S

el

<=instrReg(5eddrregWr

<=’1’;downto

3);

regRd<=’1’;next_stete

<=

loed3;reg

S

el

<=instrReg(2

downto

0);whenloed3=>vm

e

<=’1’; rw<=’0’;regWr

<=’1’;next_stete

<=

incPc;WHEEadd2

->r

egSel<-inetrReg(5downto

3)

;

--Rl;11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)11.3.4 KX9016v1控制器設(shè)計(jì)1、程序結(jié)構(gòu)2、指令的語(yǔ)句結(jié)構(gòu)接下頁(yè)11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)11.3.4 KX9016v1控制器設(shè)計(jì)3、CPU復(fù)位操作11.3 KX9016v1指令系統(tǒng)設(shè)計(jì)(7)處理PC。11.3.5

指令設(shè)計(jì)實(shí)例詳解(1)確定功能。(2)確定指令的操作碼。(3)設(shè)定相關(guān)常數(shù)。(4)增加狀態(tài)元素。(5)加入指令操作碼譯碼語(yǔ)句。(6)加入完成實(shí)際指令功能的狀態(tài)轉(zhuǎn)換語(yǔ)句。11.4 KX9016的時(shí)序仿真與硬件測(cè)試11.4.1

時(shí)序仿真與指令執(zhí)行波形分析11.4 KX9016的時(shí)序仿真與硬件測(cè)試11.4.1

時(shí)序仿真與指令執(zhí)行波形分析11.4 KX9016的時(shí)序仿真與硬件測(cè)試11.4.2 CPU工作情況的硬件測(cè)試1、嵌入式邏輯分析儀SignalTap

II測(cè)試與分析11.4 KX901

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論