?? ac51_pcon.v
字號:
//// ac51_pcon.v//// ac51 microcontroller core//// Version 0.6//// Copyright 2008, Hideyuki Abe. All rights reserved.// Distributed under the terms of the MIT License.//module ac51_pcon( clk, rst, ioaddr, iowdata, iordata, iowen, smod);input clk;input rst;input [6:0] ioaddr;input [7:0] iowdata;output [7:0] iordata;input iowen;output smod;reg [6:0] ioaddr_d;wire pcon_enb;wire pcon_wen;wire [7:0] pcon;reg smod;always @(posedge clk or negedge rst) begin if(~rst) ioaddr_d <= 7'h00; else ioaddr_d <= ioaddr;end // alwaysassign pcon_enb = (ioaddr_d == 7'h07); // PCON @8'h87assign pcon = {smod, 7'b000_0000};assign iordata = ({8{pcon_enb}} & pcon);assign pcon_wen = ((ioaddr == 7'h07) & iowen); // PCON @8'h87always @(posedge clk or negedge rst) begin if(~rst) smod <= 1'b0; else if(pcon_wen) smod <= iowdata[7];end // alwaysendmodule// End of ac51_pcon.v
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -