Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.3 2002/09/30 17:33:59 simont
|
|
// prepared header
|
|
//
|
//
|
//
|
|
|
// synopsys translate_off
|
// synopsys translate_off
|
`include "oc8051_timescale.v"
|
`include "oc8051_timescale.v"
|
// synopsys translate_on
|
// synopsys translate_on
|
|
|
`include "oc8051_defines.v"
|
`include "oc8051_defines.v"
|
|
|
|
|
|
|
module oc8051_sp (clk, rst, ram_rd_sel, ram_wr_sel, wr_addr, wr, wr_bit, data_in, data_out, data_out_r);
|
module oc8051_sp (clk, rst, ram_rd_sel, ram_wr_sel, wr_addr, wr, wr_bit, data_in, data_out);
|
//
|
//
|
// clk (in) clock
|
// clk (in) clock
|
// rst (in) reset
|
// rst (in) reset
|
// ram_rd_sel (in) ram read select, used tu calculate next value [oc8051_decoder.ram_rd_sel]
|
// ram_rd_sel (in) ram read select, used tu calculate next value [oc8051_decoder.ram_rd_sel]
|
// ram_wr_sel (in) ram write select, used tu calculate next value [oc8051_decoder.ram_wr_sel -r]
|
// ram_wr_sel (in) ram write select, used tu calculate next value [oc8051_decoder.ram_wr_sel -r]
|
// wr (in) write [oc8051_decoder.wr -r]
|
// wr (in) write [oc8051_decoder.wr -r]
|
// wr_bit (in) write bit addresable [oc8051_decoder.bit_addr -r]
|
// wr_bit (in) write bit addresable [oc8051_decoder.bit_addr -r]
|
// data_in (in) data input [oc8051_alu.des1]
|
// data_in (in) data input [oc8051_alu.des1]
|
// wr_addr (in) write address (if is addres of sp and white high must be written to sp) [oc8051_ram_wr_sel.out]
|
// wr_addr (in) write address (if is addres of sp and white high must be written to sp) [oc8051_ram_wr_sel.out]
|
// data_out (out) data output
|
// data_out (out) data output
|
// data_out_r (out) data output
|
|
//
|
//
|
|
|
|
|
input clk, rst, wr, wr_bit;
|
input clk, rst, wr, wr_bit;
|
input [1:0] ram_rd_sel;
|
input [1:0] ram_rd_sel;
|
input [2:0] ram_wr_sel;
|
input [2:0] ram_wr_sel;
|
input [7:0] data_in, wr_addr;
|
input [7:0] data_in, wr_addr;
|
output [7:0] data_out;
|
output [7:0] data_out;
|
output [7:0] data_out_r;
|
|
|
|
reg [7:0] data_out;
|
reg [7:0] data_out;
|
reg [7:0] data_out_r;
|
|
reg [7:0] temp;
|
reg [7:0] temp;
|
reg pop, write;
|
reg pop, write;
|
wire [7:0] temp1;
|
wire [7:0] temp1;
|
|
|
assign temp1 = write ? data_in : temp;
|
assign temp1 = write ? data_in : temp;
|
Line 108... |
Line 108... |
else if (write) data_out = temp1;
|
else if (write) data_out = temp1;
|
else data_out = temp1 - {7'b0, pop};
|
else data_out = temp1 - {7'b0, pop};
|
|
|
end
|
end
|
|
|
always @(posedge clk or posedge rst)
|
|
if (rst) data_out_r <= #1 8'h0;
|
|
else data_out_r <= #1 data_out;
|
|
|
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
begin
|
begin
|
if (rst)
|
if (rst)
|
pop <= #1 1'b0;
|
pop <= #1 1'b0;
|