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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? risc16f84_clk2x.v

?? 用VHDL語言實現(xiàn)的pic16f84
?? V
?? 第 1 頁 / 共 3 頁
字號:
//---------------------------------------------------------------------------
// RISC 16F84 "clk2x" core
//
// This file is part of the "risc_16F84" project.
// http://www.opencores.org/cores/risc_16F84
// 
//
// Description: See description below (which suffices for IP core
//                                     specification document.)
//
// Copyright (C) 1999 Sumio Morioka (original VHDL design version)
// Copyright (C) 2001 John Clayton and OPENCORES.ORG (this Verilog version)
//
// NOTE: This source code is free for educational/hobby use only.  It cannot
// be used for commercial purposes without the consent of Microchip
// Technology incorporated.
//
// This source file may be used and distributed without restriction provided
// that this copyright statement is not removed from the file and that any
// derivative work contains the original copyright notice and the associated
// disclaimer.
//
// This source file is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation;  either version 2.1 of the License, or
// (at your option) any later version.
//
// This source is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
// License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this source.
// If not, download it from http://www.opencores.org/lgpl.shtml
//
//---------------------------------------------------------------------------
//
// Author: John Clayton
// Date  : January 29, 2002
//
// (NOTE: Date formatted as day/month/year.)
// Update: 29/01/02 copied this file from memory_sizer.v (pared down).
//                  Translated the module and signal declarations.
//                  Transformed the instruction wires to lowercase.
//                  Transformed the addressing wires to lowercase.
// Update: 31/01/02 Translated the instruction decoder.
// Update:  5/02/02 Determined that stack is simply a circular buffer of
//                  8 locations, 13 bits per location.  Started translating
//                  "main_efsm" process.  Added all code from piccore.vhd
//                  into this file for eventual translation.  Concluded that
//                  "stack_full_node" is not needed.
// Update:  6/02/02 Translated the "ram_i_node" if/else precedural assignment.
// Update:  7/02/02 Changed all := to <=, changed all '0' to 0 and '1' to 1.
//                  Replaced all " downto " with ":".
//                  Finished translating QRESET state.
// Update: 20/02/02 Replaced all instances of Qreset with QRESET_PP.  Also
//                  replaced other state designations with their new names.
//                  Finished translating Q1, Q2 states.
// Update: 22/02/02 Translated section 2-4-1-1 (aluout register)
// Update: 27/02/02 Replaced all "or" with "||" in if statements
//                  Replaced all "and" with "&&" in if statements.
//                  Replaced all "not" with "~" in if statements.
//                  Finished translating Q3,Q4 states.
//                  Translated output signal assignments at end of code.
//                  Translated interrupt trigger processes.
// Update: 28/02/02 Finished translation of WDT and TMR0 prescaler.
//                  Trimmed line length to 80 characters throughout.
//                  Prepared to attempt initial syntax checking.
//                  Cleaned up some naming conventions, and verified that
//                  all I/O pins have _i or _o appended in the body of the
//                  code.
// Update: 03/04/02 Changed "progdata_i" to "prog_dat_i" Also changed
//                  "progadr_o" to "prog_adr_o"
// Update: 04/04/02 Created new file "risc16f84_lite.v"  This file is reduced
//                  and simplified from the original "risc16f84.v" file.
//                  Specifically, I am removing EEPROM support, and 
//                  consolidating porta and portb I/O pins so that they
//                  are bidirectional.
// Update: 04/04/02 Created a new file "risc16f84_small.v"  This file is
//                  further reduced and simplified from "risc16f84_lite.v"
//                  Specifically, I am removing the prescaler, TMR0 and WDT.
//                  Also, I am removing support for portb interrupts, leaving
//                  only rb0/int as an interrupt source.  This pin will be
//                  the only way to wake up from the SLEEP instruction...
//                  Obviously, the CLEARWDT instruction will no longer do
//                  anything.
// Update: 05/04/02 Removed the "powerdown_o", "startclk_o" and "clk_o" pins
//                  from the small design.  Also removed "rbpu_o", so if you
//                  want pullups, you have to add them explicitly in the
//                  constraints file, and option_reg[7] doesn't control them.
// Update: 08/04/02 Decided to modify "risc16f84_small.v" in order to try for
//                  more performance (only 2 states per instruction!)
//                  The new file is called "risc16f84_clk2x.v"  The resulting
//                  code was synthesized, but not tested yet.
// Update: 11/04/02 Decided to remove porta and portb from this unit, and add
//                  instead an auxiliary bus, which is intended to allow I/O
//                  using an indirect approach, similar to using the FSR.
//                  However, the aux_adr_o is 16 bits wide, so that larger
//                  RAM may be accessed indirectly by the processor... The use
//                  of FSR for this purpose proved undesirable, since any new
//                  page of RAM contains "holes" to accomodate the registers
//                  in the first 12 locations (including FSR!) so that large
//                  contiguous blocks of memory could not be accessed in an
//                  effective way.  This auxiliary bus solves that problem.
//                  Since this processor is implemented inside of an FPGA,
//                  and it is not a goal to maintain compatibility with
//                  existing libraries of code, there is no need to maintain
//                  porta and portb in the hardware.
//                  The aux_adr_lo and aux_adr_hi registers are located at
//                  88h and 89h, and the aux_dat_io location is decoded at
//                  08h.
//                  Also, changed to using "ram_we_o" instead of "readram_o"
//                  and "writeram_o"
// Update: 16/04/02 Added clock enable signal, for processor single stepping.
//                  "aux_dat_io" is only driven when "clk_en_i" is high...
// Update: 17/04/02 Removed "reset_condition" and moved "inc_pc_node" out of
//                  the clocking area, making it non-registered.  In fact, I
//                  moved everything other than the state machine out of the
//                  clocked logic section.  Changed "aluout_reg" to "aluout"
//                  since it is no longer registered.
// Update: 26/04/02 Fixed bug in aluout logic.  The AND and OR functions were
//                  coded with logical AND/OR instead of bitwise AND/OR!
// Update: 26/04/02 Changed location of aux_adr_lo and aux_adr_hi registers
//                  to 05h and 06h, respectively.  This was done to save
//                  code space because when using the aux data bus, no bank
//                  switching is necessary since they will now reside in the
//                  same bank.
// Update: 01/05/02 Fixed another bug -- the rrf and rlf instructions were
//                  coded incorrectly.
//
// Description
//---------------------------------------------------------------------------
// This logic module implements a small RISC microcontroller, with functions
// and instruction set very similar to those of the Microchip 16F84 chip.
// This work is a translation (from VHDL to Verilog) of the "CQPIC" design
// published in 1999 by Sumio Morioka of Japan, and published in the December
// 1999 issue of "Transistor Gijutsu Magazine."  The translation was performed
// by John Clayton, without the use of any translation tools.
//
// Original version used as basis for translation:  CQPIC version 1.00b
//                                                  (December 10, 2000)
//---------------------------------------------------------------------------

`define STATEBIT_SIZE 2      // Size of state machine register (bits)


module risc16f84_clk2x (
  prog_dat_i,           // [13:0] ROM read data
  prog_adr_o,           // [12:0] ROM address
  ram_dat_i,            // [7:0] RAM read data
  ram_dat_o,            // [7:0] RAM write data
  ram_adr_o,            // [8:0] RAM address; ram_adr[8:7] indicates RAM-BANK
  ram_we_o,             // RAM write strobe (H active)
  aux_adr_o,            // [15:0] Auxiliary address bus
  aux_dat_io,           // [7:0] Auxiliary data bus (tri-state bidirectional)
  aux_we_o,             // Auxiliary write strobe (H active)
  int0_i,               // PORT-B(0) INT
  reset_i,              // Power-on reset (H active)
  clk_en_i,             // Clock enable for all clocked logic
  clk_i                 // Clock input
);


// You can change the following parameters as you would like
parameter STACK_SIZE_PP      = 8;   // Size of PC stack
parameter LOG2_STACK_SIZE_PP = 3;   // Log_2(stack_size)
parameter WDT_SIZE_PP        = 255; // Size of watch dog timer (WDT)
parameter WDT_BITS_PP        = 8;   // Bits needed for watch dog timer (WDT)

// State definitions for state machine, provided as parameters to allow
// for redefinition of state values by the instantiator if desired.
parameter QRESET_PP = 3'b00;  // reset state
parameter Q2_PP     = 3'b01;  // state Q2
parameter Q4_PP     = 3'b10;  // state Q4


// I/O declarations

       // program ROM data bus/address bus
input  [13:0] prog_dat_i;   // ROM read data
output [12:0] prog_adr_o;   // ROM address

       // data RAM data bus/address bus/control signals
input  [7:0] ram_dat_i;     // RAM read data
output [7:0] ram_dat_o;     // RAM write data
output [8:0] ram_adr_o;     // RAM address; ram_adr[8:7] indicates RAM-BANK
output ram_we_o;            // RAM write strobe (H active)

       // auxiliary data bus/address bus/control signals
output [15:0] aux_adr_o;    // AUX address bus
inout  [7:0]  aux_dat_io;   // AUX data bus
output aux_we_o;            // AUX write strobe (H active)

       // interrupt input
input  int0_i;              // INT

       // CPU reset
input  reset_i;             // Power-on reset (H active)

       // CPU clock
input  clk_en_i;            // Clock enable input
input  clk_i;               // Clock input


// Internal signal declarations

     // User registers
reg  [7:0] w_reg;            // W
reg  [12:0] pc_reg;          // PCH/PCL
reg  [7:0] status_reg;       // STATUS
reg  [7:0] fsr_reg;          // FSR
reg  [4:0] pclath_reg;       // PCLATH
reg  [7:0] intcon_reg;       // INTCON
reg  [7:0] option_reg;       // OPTION
reg  [7:0] aux_adr_hi_reg;   // AUX address high byte
reg  [7:0] aux_adr_lo_reg;   // AUX address low byte

     // Internal registers for controlling instruction execution
reg  [13:0] inst_reg;        // Hold fetched op-code/operand
reg  [7:0] aluinp1_reg;      // data source (1 of 2)
reg  [7:0] aluinp2_reg;      // data source (2 of 2)
reg        c_in;             // Used with ALU data sources.
reg  exec_op_reg;            // if L (i.e. GOTO instruction etc), stall exec.
reg  intstart_reg;           // if H (i.e. interrupt), stall instr. exec.
reg  sleepflag_reg;          // if H, sleeping.


     // Stack
                             // stack (array of data-registers)
reg  [12:0] stack_reg [STACK_SIZE_PP-1:0];
                             // stack pointer (binary encoded)
reg  [LOG2_STACK_SIZE_PP-1:0] stack_pnt_reg;

     // Interrupt registers/nodes
reg  intrise_reg;            // detect positive edge of PORT-B inputs
reg  intdown_reg;            // detect negative edge of PORT-B inputs

wire rb0_int;                // Interrupt trigger

wire inte;                    // RB0   interrupt trigger
reg  intclr_reg;              // CPU; clear intrise_reg and intdown_reg

     // State register
reg  [`STATEBIT_SIZE-1:0] state_reg;

     // Result of decoding instruction -- only 1 is active at a time
wire inst_addlw;
wire inst_addwf;
wire inst_andlw;
wire inst_andwf;
wire inst_bcf;
wire inst_bsf;
wire inst_btfsc;
wire inst_btfss;
wire inst_call;
wire inst_clrf;
wire inst_clrw;
wire inst_comf;
wire inst_decf;
wire inst_decfsz;
wire inst_goto;
wire inst_incf;
wire inst_incfsz;
wire inst_iorlw;
wire inst_iorwf;
wire inst_movlw;
wire inst_movf;
wire inst_movwf;
wire inst_retfie;
wire inst_retlw;
wire inst_ret;
wire inst_rlf;
wire inst_rrf;
wire inst_sleep;
wire inst_sublw;
wire inst_subwf;
wire inst_swapf;
wire inst_xorlw;
wire inst_xorwf;

     // Result of calculating RAM access address
wire [8:0] ram_adr_node;      // RAM access address

     // These wires indicate accesses to special registers... 
     // Only 1 is active at a time.
wire addr_pcl;
wire addr_stat;
wire addr_fsr;
wire addr_pclath;
wire addr_intcon;
wire addr_option;
wire addr_aux_adr_lo;
wire addr_aux_adr_hi;
wire addr_aux_dat;
wire addr_sram;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
另类成人小视频在线| 亚洲欧洲99久久| 欧美一区二区免费视频| 日韩一级大片在线| 久久综合精品国产一区二区三区| 日韩欧美一级二级三级| 国产无人区一区二区三区| 国产日韩在线不卡| 亚洲精品伦理在线| 三级不卡在线观看| 成人性视频免费网站| 欧美在线视频全部完| 日韩一区二区高清| 最近日韩中文字幕| 日韩精品福利网| 成人精品国产免费网站| 在线日韩av片| 亚洲色图都市小说| 美女视频一区二区| 欧美日韩视频专区在线播放| 久久影院午夜片一区| 亚洲成a天堂v人片| 91丨porny丨国产| 久久综合九色综合97婷婷女人| 一二三区精品视频| 成人永久aaa| 久久精品视频在线免费观看| 天堂一区二区在线| 99麻豆久久久国产精品免费| 欧美一区二区三区免费大片| 国产精品美女久久久久av爽李琼| 国内精品嫩模私拍在线| 欧美大片在线观看一区二区| 美女网站一区二区| 日韩精品资源二区在线| 青青青伊人色综合久久| 欧美日韩免费不卡视频一区二区三区| 亚洲日本va午夜在线影院| 成人免费精品视频| 亚洲精品中文在线观看| 一本色道综合亚洲| 洋洋成人永久网站入口| 欧美亚男人的天堂| 精品成人私密视频| 亚洲人成网站精品片在线观看| 日韩av中文字幕一区二区三区| 丁香五精品蜜臀久久久久99网站| 在线看日本不卡| 色成年激情久久综合| 国产欧美一区二区在线| 国产一区二区三区免费看| 欧美一激情一区二区三区| 亚洲综合视频网| 91久久奴性调教| 一区二区三区在线视频观看| 成人黄色在线看| 欧美丝袜丝nylons| 一区二区三区美女视频| 日本韩国欧美国产| 亚洲靠逼com| 色噜噜狠狠成人中文综合| 日韩理论电影院| 国产综合成人久久大片91| 久久久久久久一区| 色综合天天视频在线观看| 一区二区不卡在线播放| 91精品国产全国免费观看 | 中文字幕乱码一区二区免费| 麻豆久久一区二区| 国产精品国产自产拍在线| 国产一区二区福利| 欧美日韩国产高清一区二区三区 | 玉足女爽爽91| 欧美午夜影院一区| 毛片av中文字幕一区二区| 欧美一二三在线| 色伊人久久综合中文字幕| 亚洲女子a中天字幕| 欧美日韩亚洲综合在线| 国产在线播放一区三区四| 久久精品一区二区三区av| av亚洲精华国产精华精华| 午夜视频在线观看一区| 欧美军同video69gay| 国产成人av影院| 亚洲午夜久久久久久久久电影院 | 欧美久久久久久蜜桃| 色综合久久久久综合| 国产麻豆欧美日韩一区| 亚洲国产精品久久人人爱蜜臀| 亚洲精品在线三区| 欧美日韩1234| 欧美日韩和欧美的一区二区| 国产成人精品影视| 国产主播一区二区| 久久久精品黄色| 欧美精品一区二区高清在线观看| 99热99精品| 色乱码一区二区三区88| 不卡电影免费在线播放一区| 久久成人免费电影| 久久国产精品色婷婷| 亚洲激情第一区| 亚洲品质自拍视频网站| 欧美日韩中文精品| 久久九九久精品国产免费直播| 56国语精品自产拍在线观看| 精品无码三级在线观看视频| 韩国精品免费视频| 一区二区在线观看不卡| 亚洲精品少妇30p| 亚洲电影视频在线| 玉米视频成人免费看| 丝袜诱惑制服诱惑色一区在线观看| 亚洲成a人v欧美综合天堂| 亚洲二区在线观看| 久久精品99国产精品| 国产蜜臀97一区二区三区| 亚洲在线观看免费视频| 男女激情视频一区| 国产麻豆视频精品| 一本色道**综合亚洲精品蜜桃冫| 国产在线精品一区二区不卡了 | 亚洲丝袜美腿综合| 亚洲视频1区2区| 七七婷婷婷婷精品国产| 国产一区二区电影| 欧美色欧美亚洲另类二区| 亚洲精品一线二线三线无人区| 亚洲国产精品激情在线观看 | 亚洲午夜精品17c| 九一久久久久久| 欧美一区二区三区四区在线观看| 午夜精品视频一区| 成人黄色777网| 久久精品亚洲一区二区三区浴池| 亚洲国产精品自拍| 播五月开心婷婷综合| 久久久综合网站| 国内成+人亚洲+欧美+综合在线| 免费成人美女在线观看| 在线播放日韩导航| 亚洲一区在线免费观看| 成人免费看黄yyy456| 欧美日韩国产免费| 中文字幕亚洲在| 99国产精品久久久| 国产精品久久久久久妇女6080 | 91精品国产免费| 丝袜亚洲另类欧美| 欧美剧情片在线观看| 日日骚欧美日韩| 精品一区二区三区欧美| 精品88久久久久88久久久| 精品一区二区三区视频 | 欧美一级生活片| 国精产品一区一区三区mba视频| 欧美一级免费大片| 亚洲欧洲日韩女同| 欧美男同性恋视频网站| 精品亚洲免费视频| 国产精品嫩草99a| 一本色道**综合亚洲精品蜜桃冫| 亚洲一区二区三区四区在线| 欧美日韩精品高清| 狠狠色丁香久久婷婷综| 亚洲视频一二三区| 国产在线播放一区二区三区| 亚洲色图在线视频| 欧美精品日韩精品| 成人免费看黄yyy456| 蜜桃视频一区二区三区在线观看| 欧美精品一二三| 丁香五精品蜜臀久久久久99网站| 中文字幕免费不卡在线| 5858s免费视频成人| 一区二区三区视频在线看| 欧美一级片在线观看| 成人性色生活片免费看爆迷你毛片| 亚洲午夜免费电影| 久久网站热最新地址| 日韩欧美成人一区二区| 久久精品亚洲一区二区三区浴池 | 91老司机福利 在线| 成人免费高清视频在线观看| 91美女精品福利| 中文字幕欧美激情| 国产一区二区成人久久免费影院| 久久午夜羞羞影院免费观看| 国产一区二区电影| 国产精品网曝门| 91视频一区二区三区| 亚洲日本一区二区| 欧美怡红院视频| 日本va欧美va精品发布| 精品国产麻豆免费人成网站| 国产精品69久久久久水密桃| 国产女主播一区| 欧美午夜电影在线播放| 捆绑紧缚一区二区三区视频|