Xilinx-fpga-CPU架构2-23-24

更新时间:2023-09-01 00:28:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Xilinx-FPGA/PLD:B603教室Xilinx Confidential -软件学院 西安电子科技大学

PARWAN-2

沈沛意、张亮 pyshen@http://www.77cn.com.cn

Recap: Parwan Bussing structure 4K memory: 16(pages)*256 vs. 4bit(pages)+8bit (locations)

Presentation Name 2

西安电子科技大学-软件学院

Demo:LIBRARY cmos; USE cmos.basic_utilities.ALL; LIBRARY par_library; USE par_library.par_utilities.ALL; USE par_library.par_parameters.ALL; -ENTITY par_central_processing_unit is GENERIC(read_high_time,read_low_time,write_high_time,write_low_time:TIME:=2US; cycle_time :TIME := 4US); PORT(clk: IN qit; interrupt: IN qit; read_mem,write_mem: OUT qit; databus:INOUT wired_byte BUS: = ‘ZZZZZZZZ’; adbus: OUT twelve); END par_central_processing_unit;

Presentation Name 3

西安电子科技大学-软件学院

Outline of the parwan behavioral description-ARCHITECTURE behavioral OF par_central_processing_unit IS BEGIN PROCESS IF interrupt =‘1’ THEN HANDLE INTERRUPT; ELSE – no interrupt READ FIRST BYTE INTO byte1, INCREMENT pc; IF byte1(7 downto 4) = single_byte_instructions THEN EXECUTE SINGLE_BYTE_INSTRUCTIONS ELSE – TWO BYTE INSTRUCTIONS READ SECOND BYTE INTO byte2, increment pc; IF byte1(7 downto 5) = jsr THEN EXECUTE jsr INSTRUCTION, byte2 HAS ADDRESS; ELSEIF byte1(7 downto 5) = bra THEN EXECUTE bra INSTRUCTION, ADDRESS IN byte2; ELSE –ALL OTHER TWO-BYTE INSTRUCTIONS ---END PROCESS; END behavioral;Presentation Name 4 西安电子科技大学-软件学院

---ELSE –ALL OTHER TWO-BYTE INSTRUCTIONS IF byte1(4) = indirect THEN USE byte1 and byte2 to get address; ENDIF; -- END indirect IF byte1(7 downto 5) = imp THEN EXECUTE jmp INSTRUCTIONS ELSEIF byte1(7 downto 5) = sta THEN EXECUTE sta INSTRUCTIONS, WIRTE ac; ELSE – READ OPERAND FOR lda, and, add, sub READ MEMORY ONTO databus; EXECUTE lda, and, add, sub; REMOVE MEMORY FROM databus; END IF; --jmp/sta/lda,and,add,sub END IF; -- jsr/bra/other double-byte instructions; END IF; --SINGLE BYTE /DOUBLE BYTE END IF; -- INTERRUPT / OTEHRWISE END PROCESS; END behavioral;Presentation Name 5 西安电子科技大学-软件学院

1.JSR execution An example of the execution of the jsr. Memory and pc are before and after jsr.

Presentation Name 6

西安电子科技大学-软件学院

An example of indirected addressing in Parwan– Indirect address: any page and any offset

Presentation Name 7

西安电子科技大学-软件学院

Indirect addressing affects offset only To obtain actual address full addressing is used To obtain data page addressing is used

Presentation Name 8

西安电子科技大学-软件学院

2. par_utilities package

Presentation Name 9

西安电子科技大学-软件学院

Presentation Name 10

西安电子科技大学-软件学院

Declarations of package of par_library Utilities required, and included in par_utilitiesPresentation Name 11 西安电子科技大学-软件学院

2.1 Functions为什么 这样设 计?

Presentation N

ame 12

西安电子科技大学-软件学院

Presentation Name 13

西安电子科技大学-软件学院

3. parameters

Presentation Name 14

西安电子科技大学-软件学院

4. Variables and behavioral descriptions Variable declarations of the behavioral model

Interrupt handling

Presentation Name 15

西安电子科技大学-软件学院

Read the first byte from mem

Read the second byte from mem

Presentation Name 16

西安电子科技大学-软件学院

Executing single byte instructions

Presentation Name 17

西安电子科技大学-软件学院

Execution of the jsr instruction

Execution of the branch instruction

Presentation Name 18

西安电子科技大学-软件学院

Handling the indirect address

Execution of jmp instruction Execution of sta instruction

Presentation Name 19

西安电子科技大学-软件学院

本文来源:https://www.bwwdw.com/article/74oi.html

Top