cpu.bdf

来自「实现简单CPU功能的源码」· BDF 代码 · 共 936 行 · 第 1/2 页

BDF
936
字号
/*
WARNING: Do NOT edit the input and output ports in this file in a text
editor if you plan to continue editing the block that represents it in
the Block Editor! File corruption is VERY likely to occur.
*/
/*
Copyright (C) 1991-2007 Altera Corporation
Your use of Altera Corporation's design tools, logic functions 
and other software and tools, and its AMPP partner logic 
functions, and any output files from any of the foregoing 
(including device programming or simulation files), and any 
associated documentation or information are expressly subject 
to the terms and conditions of the Altera Program License 
Subscription Agreement, Altera MegaCore Function License 
Agreement, or other applicable license agreement, including, 
without limitation, that your use is for the sole purpose of 
programming logic devices manufactured by Altera and sold by 
Altera or its authorized distributors.  Please refer to the 
applicable agreement for further details.
*/
(header "graphic" (version "1.3"))
(pin
	(input)
	(rect 1136 208 1304 224)
	(text "INPUT" (rect 133 0 161 10)(font "Arial" (font_size 6)))
	(text "clk" (rect 9 0 23 12)(font "Arial" ))
	(pt 168 8)
	(drawing
		(line (pt 92 12)(pt 117 12)(line_width 1))
		(line (pt 92 4)(pt 117 4)(line_width 1))
		(line (pt 121 8)(pt 168 8)(line_width 1))
		(line (pt 92 12)(pt 92 4)(line_width 1))
		(line (pt 117 4)(pt 121 8)(line_width 1))
		(line (pt 117 12)(pt 121 8)(line_width 1))
	)
	(text "VCC" (rect 136 7 156 17)(font "Arial" (font_size 6)))
)
(pin
	(output)
	(rect 1136 240 1312 256)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "acc_out[15..0]" (rect 90 0 160 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 256 1312 272)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "mbr_out[15..0]" (rect 90 0 161 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 288 1312 304)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "ir_out[7..0]" (rect 90 0 143 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 272 1312 288)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "mar_out[7..0]" (rect 90 0 156 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 304 1312 320)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "pc_out[7..0]" (rect 90 0 149 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 320 1312 336)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "alu_out[15..0]" (rect 90 0 157 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 336 1312 352)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "rom_out[31..0]" (rect 90 0 161 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 352 1312 368)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "car_out[7..0]" (rect 90 0 152 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 368 1312 384)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "br_out[15..0]" (rect 90 0 152 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 384 1312 400)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "ram_out[15..0]" (rect 90 0 161 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(pin
	(output)
	(rect 1136 400 1312 416)
	(text "OUTPUT" (rect 1 0 39 10)(font "Arial" (font_size 6)))
	(text "MUL_OUT[31..0]" (rect 90 0 172 12)(font "Arial" ))
	(pt 0 8)
	(drawing
		(line (pt 0 8)(pt 52 8)(line_width 1))
		(line (pt 52 4)(pt 78 4)(line_width 1))
		(line (pt 52 12)(pt 78 12)(line_width 1))
		(line (pt 52 12)(pt 52 4)(line_width 1))
		(line (pt 78 4)(pt 82 8)(line_width 1))
		(line (pt 82 8)(pt 78 12)(line_width 1))
		(line (pt 78 12)(pt 82 8)(line_width 1))
	)
)
(symbol
	(rect 784 -184 968 -88)
	(text "BR" (rect 5 0 20 12)(font "Arial" ))
	(text "inst3" (rect 8 80 31 92)(font "Arial" ))
	(port
		(pt 0 32)
		(input)
		(text "clk" (rect 0 0 14 12)(font "Arial" ))
		(text "clk" (rect 21 27 35 39)(font "Arial" ))
		(line (pt 0 32)(pt 16 32)(line_width 1))
	)
	(port
		(pt 0 48)
		(input)
		(text "BR_in[15..0]" (rect 0 0 61 12)(font "Arial" ))
		(text "BR_in[15..0]" (rect 21 43 82 55)(font "Arial" ))
		(line (pt 0 48)(pt 16 48)(line_width 3))
	)
	(port
		(pt 0 64)
		(input)
		(text "C" (rect 0 0 8 12)(font "Arial" ))
		(text "C" (rect 21 59 29 71)(font "Arial" ))
		(line (pt 0 64)(pt 16 64)(line_width 1))
	)
	(port
		(pt 184 32)
		(output)
		(text "BR_out[15..0]" (rect 0 0 68 12)(font "Arial" ))
		(text "BR_out[15..0]" (rect 95 27 163 39)(font "Arial" ))
		(line (pt 184 32)(pt 168 32)(line_width 3))
	)
	(drawing
		(rectangle (rect 16 16 168 80)(line_width 1))
	)
)
(symbol
	(rect 1128 -40 1320 56)
	(text "ALU" (rect 5 0 26 12)(font "Arial" ))
	(text "inst5" (rect 8 80 31 92)(font "Arial" ))
	(port
		(pt 0 32)
		(input)
		(text "clk" (rect 0 0 14 12)(font "Arial" ))
		(text "clk" (rect 21 27 35 39)(font "Arial" ))
		(line (pt 0 32)(pt 16 32)(line_width 1))
	)
	(port
		(pt 0 48)
		(input)
		(text "BR_out[15..0]" (rect 0 0 68 12)(font "Arial" ))
		(text "BR_out[15..0]" (rect 21 43 89 55)(font "Arial" ))
		(line (pt 0 48)(pt 16 48)(line_width 3))
	)
	(port
		(pt 0 64)
		(input)
		(text "C[31..0]" (rect 0 0 40 12)(font "Arial" ))
		(text "C[31..0]" (rect 21 59 61 71)(font "Arial" ))
		(line (pt 0 64)(pt 16 64)(line_width 3))
	)
	(port
		(pt 192 32)
		(output)
		(text "ACC_in[15..0]" (rect 0 0 69 12)(font "Arial" ))
		(text "ACC_in[15..0]" (rect 102 27 171 39)(font "Arial" ))
		(line (pt 192 32)(pt 176 32)(line_width 3))
	)
	(port
		(pt 192 48)
		(output)
		(text "MUL[31..0]" (rect 0 0 54 12)(font "Arial" ))
		(text "MUL[31..0]" (rect 117 43 171 55)(font "Arial" ))
		(line (pt 192 48)(pt 176 48)(line_width 3))
	)
	(drawing
		(rectangle (rect 16 16 176 80)(line_width 1))
	)
)
(symbol
	(rect 392 -200 608 -72)
	(text "MBR" (rect 5 0 28 12)(font "Arial" ))
	(text "inst8" (rect 8 112 31 124)(font "Arial" ))
	(port
		(pt 0 32)
		(input)
		(text "clk" (rect 0 0 14 12)(font "Arial" ))
		(text "clk" (rect 21 27 35 39)(font "Arial" ))
		(line (pt 0 32)(pt 16 32)(line_width 1))
	)
	(port
		(pt 0 48)
		(input)
		(text "ACC_in[15..0]" (rect 0 0 69 12)(font "Arial" ))
		(text "ACC_in[15..0]" (rect 21 43 90 55)(font "Arial" ))
		(line (pt 0 48)(pt 16 48)(line_width 3))
	)
	(port
		(pt 0 64)
		(input)
		(text "memory_in[15..0]" (rect 0 0 87 12)(font "Arial" ))
		(text "memory_in[15..0]" (rect 21 59 108 71)(font "Arial" ))
		(line (pt 0 64)(pt 16 64)(line_width 3))
	)
	(port
		(pt 0 80)
		(input)
		(text "mul_in[15..0]" (rect 0 0 63 12)(font "Arial" ))
		(text "mul_in[15..0]" (rect 21 75 84 87)(font "Arial" ))
		(line (pt 0 80)(pt 16 80)(line_width 3))
	)
	(port
		(pt 0 96)
		(input)
		(text "C[31..0]" (rect 0 0 40 12)(font "Arial" ))
		(text "C[31..0]" (rect 21 91 61 103)(font "Arial" ))
		(line (pt 0 96)(pt 16 96)(line_width 3))
	)
	(port
		(pt 216 32)
		(output)
		(text "MBR_out[15..0]" (rect 0 0 76 12)(font "Arial" ))
		(text "MBR_out[15..0]" (rect 119 27 195 39)(font "Arial" ))
		(line (pt 216 32)(pt 200 32)(line_width 3))
	)
	(drawing
		(rectangle (rect 16 16 200 112)(line_width 1))
	)
)
(symbol
	(rect 1120 -192 1320 -96)
	(text "ACC" (rect 5 0 28 12)(font "Arial" ))
	(text "inst4" (rect 8 80 31 92)(font "Arial" ))
	(port
		(pt 0 32)
		(input)
		(text "clk" (rect 0 0 14 12)(font "Arial" ))
		(text "clk" (rect 21 27 35 39)(font "Arial" ))
		(line (pt 0 32)(pt 16 32)(line_width 1))
	)
	(port
		(pt 0 48)
		(input)
		(text "ACC_in[15..0]" (rect 0 0 69 12)(font "Arial" ))
		(text "ACC_in[15..0]" (rect 21 43 90 55)(font "Arial" ))
		(line (pt 0 48)(pt 16 48)(line_width 3))
	)
	(port
		(pt 0 64)
		(input)
		(text "C" (rect 0 0 8 12)(font "Arial" ))
		(text "C" (rect 21 59 29 71)(font "Arial" ))
		(line (pt 0 64)(pt 16 64)(line_width 1))
	)
	(port
		(pt 200 32)
		(output)
		(text "ACC_out[15..0]" (rect 0 0 76 12)(font "Arial" ))
		(text "ACC_out[15..0]" (rect 103 27 179 39)(font "Arial" ))
		(line (pt 200 32)(pt 184 32)(line_width 3))
	)
	(port
		(pt 200 48)
		(output)
		(text "flag" (rect 0 0 18 12)(font "Arial" ))
		(text "flag" (rect 161 43 179 55)(font "Arial" ))
		(line (pt 200 48)(pt 184 48)(line_width 1))
	)
	(drawing
		(rectangle (rect 16 16 184 80)(line_width 1))
	)
)
(symbol
	(rect 416 120 600 248)
	(text "MAR" (rect 5 0 28 12)(font "Arial" ))
	(text "inst13" (rect 8 112 37 124)(font "Arial" ))
	(port
		(pt 0 32)
		(input)
		(text "clk" (rect 0 0 14 12)(font "Arial" ))
		(text "clk" (rect 21 27 35 39)(font "Arial" ))
		(line (pt 0 32)(pt 16 32)(line_width 1))
	)
	(port
		(pt 0 48)
		(input)
		(text "PC_in[7..0]" (rect 0 0 55 12)(font "Arial" ))
		(text "PC_in[7..0]" (rect 21 43 76 55)(font "Arial" ))
		(line (pt 0 48)(pt 16 48)(line_width 3))
	)
	(port
		(pt 0 64)
		(input)
		(text "MBR_in[7..0]" (rect 0 0 63 12)(font "Arial" ))
		(text "MBR_in[7..0]" (rect 21 59 84 71)(font "Arial" ))
		(line (pt 0 64)(pt 16 64)(line_width 3))
	)
	(port
		(pt 0 80)
		(input)
		(text "C[31..0]" (rect 0 0 40 12)(font "Arial" ))
		(text "C[31..0]" (rect 21 75 61 87)(font "Arial" ))
		(line (pt 0 80)(pt 16 80)(line_width 3))
	)
	(port
		(pt 184 32)
		(output)
		(text "MAR_out[7..0]" (rect 0 0 70 12)(font "Arial" ))
		(text "MAR_out[7..0]" (rect 93 27 163 39)(font "Arial" ))
		(line (pt 184 32)(pt 168 32)(line_width 3))
	)
	(drawing
		(rectangle (rect 16 16 168 112)(line_width 1))
	)
)
(symbol
	(rect 784 256 976 384)
	(text "C" (rect 5 0 13 12)(font "Arial" ))
	(text "inst9" (rect 8 112 31 124)(font "Arial" ))
	(port
		(pt 0 32)
		(input)
		(text "clk" (rect 0 0 14 12)(font "Arial" ))
		(text "clk" (rect 21 27 35 39)(font "Arial" ))
		(line (pt 0 32)(pt 16 32)(line_width 1))
	)
	(port
		(pt 0 48)
		(input)
		(text "C[31..0]" (rect 0 0 40 12)(font "Arial" ))
		(text "C[31..0]" (rect 21 43 61 55)(font "Arial" ))
		(line (pt 0 48)(pt 16 48)(line_width 3))
	)
	(port
		(pt 0 64)
		(input)
		(text "flag" (rect 0 0 18 12)(font "Arial" ))
		(text "flag" (rect 21 59 39 71)(font "Arial" ))
		(line (pt 0 64)(pt 16 64)(line_width 1))
	)
	(port
		(pt 0 80)
		(input)
		(text "IR_in[7..0]" (rect 0 0 51 12)(font "Arial" ))
		(text "IR_in[7..0]" (rect 21 75 72 87)(font "Arial" ))
		(line (pt 0 80)(pt 16 80)(line_width 3))
	)
	(port
		(pt 192 32)
		(output)
		(text "address_out[7..0]" (rect 0 0 86 12)(font "Arial" ))
		(text "address_out[7..0]" (rect 85 27 171 39)(font "Arial" ))
		(line (pt 192 32)(pt 176 32)(line_width 3))
	)
	(drawing

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?