Line 14... |
Line 14... |
//// Author(s): ////
|
//// Author(s): ////
|
//// - Simon Teran, simont@opencores.org ////
|
//// - Simon Teran, simont@opencores.org ////
|
//// - Dinesh Annayya, simont@opencores.org ////
|
//// - Dinesh Annayya, simont@opencores.org ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
|
//// v0.0 - Dinesh A, 5th Jan 2017
|
|
//// 1. Active edge of reset changed from High to Low
|
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Copyright (C) 2000 Authors and OPENCORES.ORG ////
|
//// Copyright (C) 2000 Authors and OPENCORES.ORG ////
|
//// ////
|
//// ////
|
//// This source file may be used and distributed without ////
|
//// This source file may be used and distributed without ////
|
//// restriction provided that this copyright statement is not ////
|
//// restriction provided that this copyright statement is not ////
|
Line 62... |
Line 65... |
|
|
`include "top_defines.v"
|
`include "top_defines.v"
|
|
|
|
|
module oc8051_ports (clk,
|
module oc8051_ports (clk,
|
rst,
|
resetn,
|
bit_in,
|
bit_in,
|
data_in,
|
data_in,
|
wr,
|
wr,
|
wr_bit,
|
wr_bit,
|
wr_addr,
|
wr_addr,
|
Line 97... |
Line 100... |
`endif
|
`endif
|
|
|
rmw);
|
rmw);
|
|
|
input clk, //clock
|
input clk, //clock
|
rst, //reset
|
resetn, //reset
|
wr, //write [oc8051_decoder.wr -r]
|
wr, //write [oc8051_decoder.wr -r]
|
wr_bit, //write bit addresable [oc8051_decoder.bit_addr -r]
|
wr_bit, //write bit addresable [oc8051_decoder.bit_addr -r]
|
bit_in, //bit input [oc8051_alu.desCy]
|
bit_in, //bit input [oc8051_alu.desCy]
|
rmw; //read modify write feature [oc8051_decoder.rmw]
|
rmw; //read modify write feature [oc8051_decoder.rmw]
|
input [7:0] wr_addr, //write address [oc8051_ram_wr_sel.out]
|
input [7:0] wr_addr, //write address [oc8051_ram_wr_sel.out]
|
Line 146... |
Line 149... |
assign p3_data = rmw ? p3_out : p3_in;
|
assign p3_data = rmw ? p3_out : p3_in;
|
`endif
|
`endif
|
|
|
//
|
//
|
// case of writing to port
|
// case of writing to port
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or negedge resetn)
|
begin
|
begin
|
if (rst) begin
|
if (resetn == 1'b0) begin
|
`ifdef OC8051_PORT0
|
`ifdef OC8051_PORT0
|
p0_out <= #1 `OC8051_RST_P0;
|
p0_out <= #1 `OC8051_RST_P0;
|
`endif
|
`endif
|
|
|
`ifdef OC8051_PORT1
|
`ifdef OC8051_PORT1
|