Line 14... |
Line 14... |
// Dependencies:
|
// Dependencies:
|
//
|
//
|
// Revision:
|
// Revision:
|
// Revision 0.01 - File Created
|
// Revision 0.01 - File Created
|
// Revision 0.02 - Fixed NMI bug
|
// Revision 0.02 - Fixed NMI bug
|
|
// Revision 0.03 - Updated clocking constants to support higher frequencies
|
// Additional Comments:
|
// Additional Comments:
|
//
|
//
|
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
Line 38... |
Line 39... |
|
|
|
|
`else
|
`else
|
|
|
module ag6502_phase_shift(input baseclk, input phi_0, output reg phi_1);
|
module ag6502_phase_shift(input baseclk, input phi_0, output reg phi_1);
|
parameter DELAY = 1; // delay in waves of baseclk
|
parameter DELAY = 1; // delay in semi-waves of baseclk
|
initial phi_1 = 0;
|
initial phi_1 = 0;
|
integer cnt = 0;
|
integer cnt = 0;
|
|
|
always @(posedge baseclk) begin
|
always @(posedge baseclk) begin
|
if (phi_0 != phi_1) begin
|
if (phi_0 != phi_1) begin
|
Line 52... |
Line 53... |
end
|
end
|
endmodule
|
endmodule
|
|
|
// baseclk is used to simulate delays on a real hardware
|
// baseclk is used to simulate delays on a real hardware
|
module ag6502_ext_clock(input baseclk, input phi_0, output phi_1, output phi_2);
|
module ag6502_ext_clock(input baseclk, input phi_0, output phi_1, output phi_2);
|
parameter DELAY1 = 3, DELAY2 = 1; // delays in waves of baseclk
|
parameter DELAY1 = 2, DELAY2 = 0; // delays in semi-waves of baseclk
|
|
|
wire phi_1_neg, phi_01;
|
wire phi_1_neg, phi_01;
|
|
|
ag6502_phase_shift#DELAY1 d1(baseclk, phi_0, phi_1_neg);
|
ag6502_phase_shift#DELAY1 d1(baseclk, phi_0, phi_1_neg);
|
assign phi_1 = ~phi_1_neg;
|
assign phi_1 = ~phi_1_neg;
|