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

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

?? risc16f84_clk2x.v

?? 用VHDL語言實(shí)現(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一区二区三区免费野_久草精品视频
色综合久久久久网| 美女视频网站久久| 日韩综合小视频| 国产主播一区二区| 91首页免费视频| 欧美一区二区三级| 国产欧美视频一区二区| 亚洲色图欧美在线| 青娱乐精品在线视频| 成人av影院在线| 欧美久久久久久久久| 久久精品亚洲精品国产欧美 | 日韩国产成人精品| 国产精品99久久久久久久vr| 一本大道久久a久久综合| 日韩精品中文字幕在线一区| 国产精品色婷婷| 日日夜夜精品视频免费| 成人午夜在线免费| 制服丝袜中文字幕亚洲| 中文字幕日韩一区| 麻豆成人久久精品二区三区红| 成人午夜视频网站| 91精品在线观看入口| 中文字幕亚洲成人| 精品一区二区三区在线播放| 91官网在线观看| 国产欧美一区二区三区鸳鸯浴| 亚洲成人7777| 99视频有精品| 久久综合精品国产一区二区三区 | 欧美视频一区二区三区四区 | 国产69精品久久久久777| 欧美日韩五月天| ㊣最新国产の精品bt伙计久久| 日韩电影在线免费| 色综合久久精品| 久久久噜噜噜久久人人看| 丝袜脚交一区二区| 99免费精品在线| 国产日韩欧美综合一区| 欧美精品日韩一本| 亚洲欧洲日韩综合一区二区| 国内偷窥港台综合视频在线播放| 欧美亚洲另类激情小说| 成人欧美一区二区三区1314| 国产一区二区0| 日韩欧美激情四射| 日日摸夜夜添夜夜添国产精品| 91蜜桃免费观看视频| 国产日韩av一区| 激情综合五月婷婷| 日韩欧美二区三区| 日韩二区三区四区| 欧美久久免费观看| 午夜精品久久一牛影视| 日本丶国产丶欧美色综合| 国产精品成人一区二区艾草 | 久久精品男人的天堂| 久久99久久99精品免视看婷婷 | 久久国产生活片100| 91精品国产色综合久久ai换脸 | 精品国产污污免费网站入口| 性感美女极品91精品| 欧美三区在线视频| 亚洲福利一区二区三区| 欧美性xxxxx极品少妇| 亚洲影视资源网| 欧美影片第一页| 亚洲精品日韩专区silk| 99国产欧美久久久精品| 亚洲伦在线观看| 91污在线观看| 樱桃国产成人精品视频| 色婷婷激情综合| 亚洲一区av在线| 欧美日韩www| 午夜日韩在线观看| 欧美一级生活片| 捆绑变态av一区二区三区| 欧美成人精品1314www| 久久9热精品视频| 久久久久久久综合狠狠综合| 丰满放荡岳乱妇91ww| 国产精品欧美久久久久无广告 | 亚洲欧美日韩国产一区二区三区 | 亚洲午夜精品在线| 日本欧美肥老太交大片| 欧美一区二区免费| 国产综合色在线视频区| 国产日产精品一区| 99国产精品99久久久久久| 亚洲精品水蜜桃| 欧美三级中文字| 日本麻豆一区二区三区视频| 日韩美女一区二区三区四区| 国产成人综合自拍| 18成人在线视频| 欧美视频日韩视频| 美女www一区二区| 国产午夜三级一区二区三| 成人性色生活片免费看爆迷你毛片| 亚洲色图视频网| 91精品国产综合久久久久久久久久| 蜜桃av一区二区| 国产精品天美传媒| 欧美视频中文一区二区三区在线观看| 青青草视频一区| 国产精品无码永久免费888| 色综合久久中文综合久久97| 三级不卡在线观看| 国产精品污www在线观看| 欧美羞羞免费网站| 九色|91porny| 国产精品成人一区二区艾草 | 日本不卡视频在线观看| 欧美国产97人人爽人人喊| 欧美午夜电影网| 国产精品亚洲一区二区三区妖精 | 欧美中文字幕亚洲一区二区va在线| 天堂资源在线中文精品| 久久久久久9999| 91久久免费观看| 久99久精品视频免费观看| 亚洲三级免费观看| 日韩精品最新网址| 一本色道久久综合狠狠躁的推荐| 免费一区二区视频| 亚洲黄色小视频| 久久久久99精品国产片| 欧美色国产精品| 波多野结衣在线aⅴ中文字幕不卡| 五月天激情综合网| 中文一区二区在线观看| 欧美精选一区二区| 91日韩在线专区| 九九热在线视频观看这里只有精品| 亚洲女爱视频在线| 久久久久久久久久久电影| 欧美三级日韩三级| 不卡一区中文字幕| 久久精品国产一区二区三| 亚洲制服丝袜在线| 国产精品美日韩| 日韩久久久久久| 精品视频一区二区不卡| 不卡高清视频专区| 欧美96一区二区免费视频| 一片黄亚洲嫩模| 国产精品麻豆网站| 精品成人在线观看| 欧美午夜不卡视频| 亚洲人午夜精品天堂一二香蕉| 精品久久国产97色综合| 欧美猛男男办公室激情| 成人av网站在线观看免费| 国产一区二区在线看| 青青青伊人色综合久久| 亚洲成在人线在线播放| 亚洲激情欧美激情| 国产精品久久久久久福利一牛影视| 欧美变态凌虐bdsm| 日韩欧美一二区| 欧美日韩视频不卡| 欧美色欧美亚洲另类二区| 一本大道av一区二区在线播放| 成人免费毛片app| 国产成人综合亚洲网站| 国产一区二区精品久久91| 蜜臀va亚洲va欧美va天堂| 亚洲国产cao| 亚洲国产一区二区视频| 亚洲激情图片小说视频| 亚洲伦理在线免费看| 一区二区中文视频| 亚洲日本一区二区三区| 成人免费一区二区三区在线观看| 亚洲国产高清aⅴ视频| 久久综合久久99| 久久免费美女视频| 久久综合99re88久久爱| 久久婷婷国产综合国色天香| 精品女同一区二区| 日韩欧美国产wwwww| 欧美v国产在线一区二区三区| 日韩欧美国产麻豆| 精品国产乱码久久久久久老虎 | 国内精品久久久久影院一蜜桃| 奇米影视一区二区三区| 麻豆高清免费国产一区| 精彩视频一区二区| 国产99精品国产| 不卡一区在线观看| 色狠狠av一区二区三区| 日本道在线观看一区二区| 欧美日韩视频在线观看一区二区三区 | 精品91自产拍在线观看一区| 久久综合九色综合久久久精品综合 | 偷拍一区二区三区四区| 蜜桃91丨九色丨蝌蚪91桃色|