亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pic.v

?? verilog實例100多個
?? V
?? 第 1 頁 / 共 5 頁
字號:
// 
// SYNTHETIC PIC 2.0                                          4/23/98
//
//    This is a synthesizable Microchip 16C57 compatible
//    microcontroller.  This core is not intended as a high fidelity model of
//    the PIC, but simply a way to offer a simple processor core to people
//    familiar with the PIC who also have PIC tools.  
//
//    pictest.v  -   top-level testbench (NOT SYNTHESIZABLE)
//    piccpu.v   -   top-level synthesizable module
//    picregs.v  -   register file instantiated under piccpu
//    picalu.v   -   ALU instantiated under piccpu
//    picidec.v  -   Instruction Decoder instantiated under piccpu
//    hex2rom.c  -   C program used to translate MPLAB's INTEL HEX output
//                   into the Verilog $readmemh compatible file
//    test*.asm  -   (note the wildcard..) Several test programs used
//                   to help debug the verilog.  I used MPLAB and the simulator
//                   to develop these programs and get the expected results.
//                   Then, I ran them on Verilog-XL where they appeared to
//                   match.
//
//    Copyright, Tom Coonan, '97.
//    Use freely, but not for resale as is.  You may use this in your
//    own projects as desired.  Just don't try to sell it as is!
//
//
module picalu (
   op,
   a,
   b,
   y,
   cin,
   cout,
   zout
);

input  [3:0]	op;	// ALU Operation
input  [7:0]	a;	// 8-bit Input a
input  [7:0]	b;	// 8-bit Input b
output [7:0]	y;	// 8-bit Output
input		cin;
output		cout;
output		zout;

// Reg declarations for outputs
reg		cout;
reg		zout;
reg [7:0]	y;

// Internal declarations
reg		addercout; // Carry out straight from the adder itself.
 
parameter [3:0] ALUOP_ADD        = 4'b0000;
parameter [3:0] ALUOP_SUB        = 4'b1000;
parameter [3:0] ALUOP_AND        = 4'b0001;
parameter [3:0] ALUOP_OR         = 4'b0010;
parameter [3:0] ALUOP_XOR        = 4'b0011;
parameter [3:0] ALUOP_COM        = 4'b0100;
parameter [3:0] ALUOP_ROR        = 4'b0101;
parameter [3:0] ALUOP_ROL        = 4'b0110;
parameter [3:0] ALUOP_SWAP       = 4'b0111;


always @(a or b or cin or op) begin
   case (op) // synopsys full_case parallel_case
      ALUOP_ADD:  {addercout,  y}  <= a + b;
      ALUOP_SUB:  {addercout,  y}  <= a - b; // Carry out is really "borrow"
      ALUOP_AND:  {addercout,  y}  <= {1'b0, a & b};
      ALUOP_OR:   {addercout,  y}  <= {1'b0, a | b};
      ALUOP_XOR:  {addercout,  y}  <= {1'b0, a ^ b};
      ALUOP_COM:  {addercout,  y}  <= {1'b0, ~a};
      ALUOP_ROR:  {addercout,  y}  <= {a[0], cin, a[7:1]};
      ALUOP_ROL:  {addercout,  y}  <= {a[7], a[6:0], cin};
      ALUOP_SWAP: {addercout,  y}  <= {1'b0, a[3:0], a[7:4]};
      default:    {addercout,  y}  <= {1'b0, 8'h00};
   endcase
end

always @(y)
   zout <= (y == 8'h00);

always @(addercout or op)
   if (op == ALUOP_SUB) cout <= ~addercout; // Invert adder's carry to get borrow
   else                 cout <=  addercout;
      
endmodule
// 
// SYNTHETIC PIC 2.0                                          4/23/98
//
//    This is a synthesizable Microchip 16C57 compatible
//    microcontroller.  This core is not intended as a high fidelity model of
//    the PIC, but simply a way to offer a simple processor core to people
//    familiar with the PIC who also have PIC tools.  
//
//    pictest.v  -   top-level testbench (NOT SYNTHESIZABLE)
//    piccpu.v   -   top-level synthesizable module
//    picregs.v  -   register file instantiated under piccpu
//    picalu.v   -   ALU instantiated under piccpu
//    picidec.v  -   Instruction Decoder instantiated under piccpu
//    hex2rom.c  -   C program used to translate MPLAB's INTEL HEX output
//                   into the Verilog $readmemh compatible file
//    test*.asm  -   (note the wildcard..) Several test programs used
//                   to help debug the verilog.  I used MPLAB and the simulator
//                   to develop these programs and get the expected results.
//                   Then, I ran them on Verilog-XL where they appeared to
//                   match.
//
//    Copyright, Tom Coonan, '97.
//    Use freely, but not for resale as is.  You may use this in your
//    own projects as desired.  Just don't try to sell it as is!
//
//
module piccpu (
   clk,
   reset,
   paddr,
   pdata,
   portain,
   portbout,
   portcout,
   
   debugw,
   debugpc,
   debuginst,
   debugstatus
);

input		clk;
input		reset;
output [8:0]	paddr;
input  [11:0]	pdata;
input  [7:0]	portain;
output [7:0]	portbout;
output [7:0]	portcout;

output [7:0]	debugw;
output [8:0]	debugpc;
output [11:0]	debuginst;
output [7:0]	debugstatus;

// Register declarations for outputs
reg [8:0]	paddr;
reg [7:0]	portbout;
reg [7:0]	portcout;

// This should be set to the ROM location where our restart vector is.
// As set here, we have 512 words of program space.
//
parameter RESET_VECTOR = 9'h1FF;

parameter	INDF_ADDRESS	= 3'h0,
		TMR0_ADDRESS	= 3'h1,
		PCL_ADDRESS	= 3'h2,
		STATUS_ADDRESS	= 3'h3,
		FSR_ADDRESS	= 3'h4,
		PORTA_ADDRESS	= 3'h5,
		PORTB_ADDRESS	= 3'h6,
		PORTC_ADDRESS	= 3'h7;

// Experimental custom peripheral, "Lil Adder (a 4-bit adder)" is at this address.
//
parameter	EXPADDRESS_LILADDER = 7'h7F;

// *********  Special internal registers

// Instruction Register
reg  [11:0]	inst;

// Program Counter
reg  [8:0]	pc;
reg  [8:0]	pcplus1; // Output of the pc incrementer.

// Stack Registers and Stack "levels" register.
reg [ 1:0]	stacklevel;
reg [ 8:0]	stack1;
reg [ 8:0]	stack2;

// W Register
reg [ 7:0]	w;

// The STATUS register (#3) is 8 bits wide, however, we only currently use 2 bits
// of it; the C and Z bit.
//
// bit 0  -  C
// bit 2  -  Z
//
reg [ 7:0]	status;

// The FSR register is the pointer register used for Indirect addressing (e.g. using INDF).
reg  [ 7:0]	fsr;

// Timer 0
reg  [ 7:0]	tmr0;
reg  [ 7:0]	prescaler;

// Option Register
reg [7:0]	option;

// Tristate Control registers. We do not neccessarily support bidirectional ports, but
//    will save a place for these registers and the TRIS instruction.  Use for debug.
reg [7:0]	trisa;
reg [7:0]	trisb;
reg [7:0]	trisc;

// I/O Port registers
//
reg [7:0]	porta;	// Input PORT
reg [7:0]	portb;	// Output PORT
reg [7:0]	portc;	// Output PORT

// ********** Instruction Related signals ******

reg 		skip;  // When HI force a NOP (all zeros) into inst

reg  [2:0]	pcinsel;

// Derive special sub signals from inst register
wire [ 7:0]	k;
wire [ 4:0]	fsel;
wire [ 8:0]	longk;
wire		d;
wire [ 2:0]	b;

// ********** File Address ************
//
// This is the 7-bit Data Address that includes the lower 5-bit fsel, the
// FSR bits and any indirect addressing.
// Use this bus to address the Register File as well as all special registers, etc.
//
reg [6:0]	fileaddr;

// Address Selects
reg		specialsel;
reg		regfilesel;
reg		expsel;

// ******  Instruction Decoder Outputs **************

// Write enable for the actual ZERO and CARRY bits within the status register.
// Generated by the Instruction Decoder.
//
wire [1:0]	aluasel;
wire [1:0]	alubsel;
wire [3:0]	aluop;

wire		zwe;
wire		cwe;

wire		isoption;
wire		istris;

wire		fwe;	// High if any "register" is being written to at all.
wire		wwe;	// Write Enable for the W register.  Produced by Instruction Decoder.

// *************  Internal Busses, mux connections, etc.  ********************

// Bit decoder bits.  
reg [7:0]	bd;	// Final decoder value after any polarity inversion.
reg [7:0]	bdec;	// e.g. "Bit Decoded"

// Data in and out of the and out of the register file
//
reg [7:0]	regfilein;	// Input into Register File, is connected to the dbus.
wire [7:0]	regfileout;	// Path leaving the register file, goes to SBUS Mux
reg		regfilewe;	// Write Enable
reg		regfilere;	// Read Enable

//
// The dbus (Destination Bus) comes out of the ALU.  It is available to all
// writable registers.
//
// The sbus (Source Bus) comes from all readable registers as well as the output
// of the Register File.  It is one of the primary inputs into the ALU muxes.
//
// The ebus (Expansion Bus) comes from any of our custom modules.  They must
// all coordinate to place whoever's data onto ebus.
//
reg  [7:0]	dbus;
reg  [7:0]	sbus;
reg  [7:0]	ebus;


// ALU Signals
//
reg  [7:0]	alua;
reg  [7:0]	alub;
wire [7:0]	aluout;
wire 		alucin;
wire		alucout;
wire       	aluz;

// ALU A and B mux selects.
//
parameter [1:0]	ALUASEL_W	= 2'b00,
		ALUASEL_SBUS	= 2'b01,
		ALUASEL_K	= 2'b10,
		ALUASEL_BD	= 2'b11;
		
parameter [1:0]	ALUBSEL_W	= 2'b00,
		ALUBSEL_SBUS	= 2'b01,
		ALUBSEL_K	= 2'b10,
		ALUBSEL_1	= 2'b11;

// ALU Operation codes.
//		
parameter  [3:0] ALUOP_ADD  = 4'b0000;
parameter  [3:0] ALUOP_SUB  = 4'b1000;
parameter  [3:0] ALUOP_AND  = 4'b0001;
parameter  [3:0] ALUOP_OR   = 4'b0010;
parameter  [3:0] ALUOP_XOR  = 4'b0011;
parameter  [3:0] ALUOP_COM  = 4'b0100;
parameter  [3:0] ALUOP_ROR  = 4'b0101;
parameter  [3:0] ALUOP_ROL  = 4'b0110;
parameter  [3:0] ALUOP_SWAP = 4'b0111;


// Instantiate each of our subcomponents
//
picregs  regs (
   .clk		(clk), 
   .reset	(reset),
   .we  	(regfilewe),
   .re		(regfilere),
   .bank	(fileaddr[6:5]), 
   .location	(fileaddr[4:0]),
   .din		(regfilein), 
   .dout	(regfileout)
);

// Instatiate the ALU.
//
picalu   alu  (
   .op         (aluop), 
   .a          (alua), 
   .b          (alub),
   .y          (aluout),
   .cin        (status[0]), 
   .cout       (alucout), 
   .zout       (aluz)
);

// Instantiate the Instruction Decoder.  This is really just a lookup table.
// Given the instruction, generate all the signals we need.  
//
// For example, each instruction implies a specific ALU operation.  Some of
// these are obvious such as the ADDW uses an ADD alu op.  Less obvious is
// that a mov instruction uses an OR op which lets us do a simple copy.
// 
// Data has to funnel through the ALU, which sometimes makes for contrived
// ALU ops.
//
picidec  idec (
   .inst     (inst),
   .aluasel  (aluasel),
   .alubsel  (alubsel),
   .aluop    (aluop),
   .wwe      (wwe),
   .fwe      (fwe),
   .zwe      (zwe),
   .cwe      (cwe),
   .bdpol    (bdpol),
   .option   (isoption),
   .tris     (istris)
);

// *********** Debug ****************
assign	debugw = w;
assign	debugpc = pc;
assign	debuginst = inst;
assign	debugstatus = status;

// *********** REGISTER FILE Addressing ****************
//
// We implement the following:
//    - The 5-bit fsel address is within a "BANK" which is 32 bytes.
//    - The FSR bits 6:5 are the BANK select, so there are 4 BANKS, a 
//      total of 128 bytes.  Minus the 8 special registers, that's 
//      really 120 bytes.
//    - The INDF register is for indirect addressing.  Referencing INDF
//      uses FSR as the pointer.  Therefore, using INDF/FSR you address
//      7-bits of memory.
// We DO NOT currently implement the PAGE for program (e.g. STATUS register
// bits 6:5)
//
// The fsel address *may* be zero in which case, we are to do indirect
// addressing, using FSR register as the 8-bit pointer.
//
// Otherwise, use the 5-bits of FSEL (from the Instruction itself) and 
// 2 bank bits from the FSR register (bits 6:5).
//
always @(fsel or fsr) begin
   if (fsel == INDF_ADDRESS) begin
      // The INDEX register is addressed.  There really is no INDEX register.
      // Use the FSR as an index, e.g. the FSR contents are the fsel.
      //
      fileaddr <= fsr[6:0];
   end
   else begin
      // Use FSEL field and status bank select bits
      //
      fileaddr <= {fsr[6:5], fsel};
   end
end

// Write Enable to Register File.  
// Assert this when the general fwe (write enable to *any* register) is true AND Register File
//    address range is specified.
//  
always @(regfilesel or fwe)
   regfilewe <= regfilesel & fwe;

// Read Enable (this if nothing else, helps in debug.)
// Assert if Register File address range is specified AND the ALU is actually using some
//    data off the SBUS.
//   
always @(regfilesel or aluasel or alubsel)
   regfilere <= regfilesel & ((aluasel == ALUASEL_SBUS) | (alubsel == ALUBSEL_SBUS));

// *********** Address Decodes **************
//
// Generate 3 selects: specialsel, regfilesel and expsel
always @(fileaddr) begin
   casex (fileaddr)
      7'bXX00XXX: // The SPECIAL Registers are lower 8 addresses, in ALL BANKS
         begin
            specialsel	<= 1'b1;
            regfilesel	<= 1'b0;
            expsel	<= 1'b0;
         end
      7'b1111111: // EXPANSION Registers are the top (1) addresses
         begin
            specialsel	<= 1'b0;
            regfilesel	<= 1'b0;
            expsel	<= 1'b1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av在线播放中文字幕| 亚洲天堂2016| 欧美一级夜夜爽| 欧美日韩你懂的| 在线视频一区二区三| 在线精品观看国产| 在线播放欧美女士性生活| 777午夜精品视频在线播放| 欧美电影一区二区| 日韩亚洲欧美高清| 久久奇米777| 亚洲人一二三区| 亚洲va中文字幕| 韩国精品在线观看| 成人av片在线观看| 在线视频欧美精品| 欧美一三区三区四区免费在线看| 91精品一区二区三区在线观看| 日韩一级欧美一级| 国产欧美日韩在线观看| 亚洲女与黑人做爰| 另类成人小视频在线| 粉嫩蜜臀av国产精品网站| 色婷婷av一区二区三区之一色屋| 91成人国产精品| 欧美第一区第二区| 国产精品久久久久久久久果冻传媒| 亚洲色大成网站www久久九九| 亚洲国产精品久久人人爱蜜臀| 美腿丝袜亚洲一区| 99re亚洲国产精品| 7777精品伊人久久久大香线蕉的 | 中文字幕中文字幕一区| 综合自拍亚洲综合图不卡区| 一区二区三区欧美久久| 久久国产精品99久久人人澡| 成人免费的视频| 91精品欧美一区二区三区综合在 | 日韩一区二区免费在线观看| 国产亚洲午夜高清国产拍精品 | 久久精品一区蜜桃臀影院| 亚洲欧美一区二区三区极速播放| 日日骚欧美日韩| 成人精品小蝌蚪| 日韩一二三区不卡| 一区av在线播放| 国产69精品一区二区亚洲孕妇| 色八戒一区二区三区| 国产婷婷一区二区| 免费人成在线不卡| 欧美午夜不卡在线观看免费| 国产精品无码永久免费888| 免费av网站大全久久| 91麻豆国产在线观看| 精品久久久久一区二区国产| 亚洲一区在线观看免费观看电影高清 | 亚洲欧美综合在线精品| 蜜臀av亚洲一区中文字幕| 91小视频免费观看| 国产精品乱人伦一区二区| 精品亚洲成a人| 日韩三级视频在线观看| 午夜久久久影院| 欧美在线高清视频| 亚洲天堂久久久久久久| 粗大黑人巨茎大战欧美成人| 久久影院电视剧免费观看| 蜜桃一区二区三区四区| 日韩欧美www| 免费久久99精品国产| 91精品国产色综合久久不卡电影| 午夜精品久久久久久| 欧美三区免费完整视频在线观看| 国产精品乱子久久久久| 99久久er热在这里只有精品15| 国产欧美日韩在线看| 国产丶欧美丶日本不卡视频| 国产丝袜在线精品| 成人午夜精品一区二区三区| 中文字幕+乱码+中文字幕一区| 国产91丝袜在线18| 国产精品麻豆久久久| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲欧美在线aaa| 日本韩国视频一区二区| 亚洲午夜激情av| 91精品国产综合久久蜜臀| 免费观看在线色综合| 久久精品亚洲乱码伦伦中文| 成人免费毛片高清视频| 亚洲蜜臀av乱码久久精品蜜桃| 日本精品一级二级| 青青草原综合久久大伊人精品| 精品美女在线播放| 99r精品视频| 日韩精品三区四区| 久久精品亚洲精品国产欧美kt∨ | 亚洲国产精品久久久久秋霞影院| 欧美精品视频www在线观看| 青青草伊人久久| 国产午夜亚洲精品理论片色戒| 成人av高清在线| 亚洲一区欧美一区| 久久色中文字幕| 91蜜桃在线免费视频| 午夜a成v人精品| 久久久久高清精品| 在线中文字幕一区| 国产精品亚洲第一| 亚洲影视在线播放| 欧美激情在线看| 3atv一区二区三区| 成年人国产精品| 日本麻豆一区二区三区视频| 国产精品理伦片| 日韩欧美电影一二三| 色屁屁一区二区| 国产大陆精品国产| 蜜桃91丨九色丨蝌蚪91桃色| 亚洲欧美中日韩| 精品免费日韩av| 欧美日韩国产123区| 国产成人精品免费| 免费高清在线一区| 亚洲国产成人高清精品| 国产精品色哟哟网站| 日韩一区二区三区四区五区六区| 色呦呦日韩精品| 岛国精品在线观看| 韩国女主播一区| 日本成人在线看| 婷婷久久综合九色综合绿巨人| 国产精品久久久久久久岛一牛影视| 欧美一区二区大片| 91精品91久久久中77777| 成人av电影免费观看| 国产原创一区二区三区| 蜜臀av一区二区在线观看| 亚洲成av人片| 亚洲国产精品一区二区久久恐怖片 | 美女视频网站黄色亚洲| 亚洲综合免费观看高清完整版| 国产精品午夜在线| 国产亚洲制服色| www亚洲一区| 精品久久国产老人久久综合| 欧美疯狂性受xxxxx喷水图片| 色激情天天射综合网| 91色在线porny| 91玉足脚交白嫩脚丫在线播放| 国产不卡视频一区二区三区| 国产一区二三区好的| 国产麻豆精品视频| 激情久久五月天| 国产精品性做久久久久久| 国产精品亚洲综合一区在线观看| 国产最新精品免费| 国产成人a级片| zzijzzij亚洲日本少妇熟睡| 成人开心网精品视频| 92精品国产成人观看免费| 99久久免费精品高清特色大片| www.成人网.com| 在线观看亚洲成人| 制服丝袜亚洲色图| 欧美成人一级视频| 国产亚洲一区二区在线观看| 国产女同互慰高潮91漫画| 1区2区3区欧美| 亚洲成人在线网站| 久久精品国产网站| 成人黄色免费短视频| 91成人免费在线| 欧美电视剧在线观看完整版| 久久精品亚洲国产奇米99| 亚洲视频中文字幕| 日产精品久久久久久久性色| 国产精品一区二区在线播放| av电影天堂一区二区在线| 欧美日韩国产片| 久久久精品免费观看| 亚洲丝袜精品丝袜在线| 日韩福利电影在线| 成人av资源在线| 日韩一区二区三区高清免费看看| 久久久久久一二三区| 一区二区三区精品在线观看| 六月丁香婷婷色狠狠久久| av在线播放一区二区三区| 7878成人国产在线观看| 国产精品美女一区二区三区| 日日夜夜精品视频免费| 成人国产精品免费网站| 欧美一级夜夜爽| 亚洲欧美综合网| 久久69国产一区二区蜜臀| 色哟哟一区二区三区| 精品日韩一区二区| 亚洲一区在线观看视频| 懂色av一区二区在线播放|