ac51_pcon.v

来自「Verilog 8051 IP Core for Cyclone II」· Verilog 代码 · 共 64 行

V
64
字号
//// 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 + =
减小字号Ctrl + -
显示快捷键?