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

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

?? risc16f84_clk2x.v

?? vga ipcore的verilog代碼
?? 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.
// Update: 03/05/02 Fixed another bug -- the carry bit was incorrect (the
//                  problem was discovered while performing SUBWF X,W where
//                  W contained 0 and X contained 1. (1-0).  The logic for
//                  the carry bit appears to have been incorrect even in
//                  the original VHDL code by Sumio Morioka.
//
// 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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品免费观看| 亚洲高清久久久| 成人一区在线看| 欧美激情在线一区二区三区| 国产999精品久久久久久绿帽| 亚洲国产精品成人久久综合一区| 成人av免费观看| 亚洲精品国产一区二区精华液| 欧美又粗又大又爽| 日日夜夜精品免费视频| 欧美变态tickling挠脚心| 国产九色精品成人porny| 国产精品久久久久久久久搜平片 | 国产91精品欧美| 成人av在线观| 亚洲免费观看高清在线观看| 在线观看国产日韩| 美女www一区二区| 中文av一区特黄| 在线看日本不卡| 青青草精品视频| 国产欧美日韩麻豆91| 一本色道久久综合亚洲aⅴ蜜桃| 成人毛片老司机大片| 亚洲男人电影天堂| 精品久久国产字幕高潮| 成av人片一区二区| 日本成人在线看| 一区二区中文字幕在线| 日韩一级大片在线观看| 99麻豆久久久国产精品免费优播| 亚洲h动漫在线| 国产精品嫩草久久久久| 欧美精品第一页| 97aⅴ精品视频一二三区| 日韩欧美一区在线| 欧美一区二区福利视频| 国内精品自线一区二区三区视频| 中文字幕不卡的av| 91精品麻豆日日躁夜夜躁| 成人午夜电影网站| 久久国产精品99久久久久久老狼| 亚洲美女精品一区| 久久这里只有精品首页| 欧美日韩国产大片| 91毛片在线观看| 国产精品一区在线| 免费成人深夜小野草| 亚洲精品国产成人久久av盗摄| 日韩欧美成人激情| 欧美三级中文字| 99综合影院在线| 精品一区二区三区久久久| 一区二区三区日韩精品| 中文字幕不卡在线播放| 欧美一区二区视频在线观看2022| 91久久精品一区二区三区| 欧美美女黄视频| 91官网在线免费观看| 高清日韩电视剧大全免费| 全部av―极品视觉盛宴亚洲| 一区二区三区中文字幕精品精品| 久久久久久久久久电影| 日韩欧美在线1卡| 欧美日韩一区不卡| 在线免费视频一区二区| 99久久777色| 不卡av免费在线观看| 国产乱一区二区| 久久er99热精品一区二区| 秋霞影院一区二区| 日本不卡1234视频| 麻豆精品视频在线观看视频| 天天操天天干天天综合网| 亚洲国产精品一区二区久久| 亚洲精品一二三| 亚洲最色的网站| 亚洲国产婷婷综合在线精品| 亚洲欧美激情小说另类| 一区二区三区在线观看国产 | 免费黄网站欧美| 奇米影视7777精品一区二区| 日本美女一区二区三区视频| 免费精品视频最新在线| 精品一区二区三区久久| 精品久久久久久久久久久久久久久| 91麻豆精品在线观看| 91激情五月电影| 欧美亚洲一区二区在线观看| 欧美日韩在线播放三区四区| 欧美另类高清zo欧美| 欧美一区二区播放| 久久网这里都是精品| 国产日韩精品久久久| 亚洲欧美综合色| 夜夜嗨av一区二区三区中文字幕 | 亚洲电影你懂得| 免费一区二区视频| 国产成人精品www牛牛影视| 白白色亚洲国产精品| 国产欧美一区二区精品性| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 欧美一级欧美三级在线观看| 日韩欧美一区二区视频| 久久精品日产第一区二区三区高清版 | 日韩精品每日更新| 久久99精品国产| 99久久久国产精品| 欧美日本一道本| 久久九九99视频| 亚洲自拍都市欧美小说| 久久国内精品自在自线400部| 国产不卡免费视频| 欧美专区日韩专区| 日韩久久精品一区| 亚洲视频每日更新| 蜜桃视频一区二区| www.亚洲国产| 日韩欧美国产三级电影视频| 国产精品国产三级国产普通话三级| 图片区小说区国产精品视频| 久久99国产精品免费| av在线一区二区| 欧美一区二区三级| 亚洲人吸女人奶水| 久久久噜噜噜久久人人看| 久久女同互慰一区二区三区| 中文字幕亚洲不卡| 日韩电影免费一区| 91视频免费观看| 久久久蜜桃精品| 丝袜诱惑制服诱惑色一区在线观看 | 国产精品成人免费在线| 午夜不卡av在线| 99re在线精品| 久久精品在线观看| 日韩二区在线观看| 91国产丝袜在线播放| 国产欧美精品一区aⅴ影院 | 亚洲第一成人在线| 成人av资源在线| 久久午夜免费电影| 日本欧美加勒比视频| 色妞www精品视频| 国产精品毛片无遮挡高清| 蜜臀精品一区二区三区在线观看 | 欧美日本国产视频| 国产精品久久久久久久第一福利 | 一区二区中文视频| 国产精品白丝av| 欧美一区二区三区男人的天堂| 亚洲视频免费观看| 成人开心网精品视频| 26uuu色噜噜精品一区二区| 日日噜噜夜夜狠狠视频欧美人| 色综合中文字幕国产 | 蜜臀av性久久久久蜜臀av麻豆| 91精品福利视频| 亚洲欧洲日韩在线| 日韩写真欧美这视频| 亚洲黄色av一区| 色噜噜狠狠成人中文综合| 国产精品福利一区二区| 国产精品综合二区| 精品处破学生在线二十三| 日韩vs国产vs欧美| 91精品国产91久久综合桃花| 偷拍一区二区三区| 欧美高清你懂得| 日日夜夜精品免费视频| 91麻豆精品国产91久久久 | 精品国产乱码久久久久久闺蜜| 亚洲成人三级小说| 欧美日韩综合在线免费观看| 亚洲国产精品人人做人人爽| 精品视频在线看| 首页亚洲欧美制服丝腿| 欧美一级搡bbbb搡bbbb| 免费成人你懂的| 久久久久久一级片| 成人黄色电影在线| 亚洲精品五月天| 欧美色网一区二区| 日韩黄色小视频| 欧美精品一区二区三区在线| 国产老女人精品毛片久久| 国产欧美一区二区精品性| 成人自拍视频在线| 风间由美一区二区av101| 欧美欧美欧美欧美| 开心九九激情九九欧美日韩精美视频电影 | 久久久不卡影院| 国产成人精品aa毛片| 亚洲视频免费在线观看| 欧美网站一区二区| 麻豆国产精品一区二区三区| 精品福利在线导航| 91在线视频观看| 同产精品九九九| 国产亚洲精品bt天堂精选|