-------- Forwarded Message --------
Walter,
I tried your proposed solution and couldn't make it work.
It "almost" works in that it starts the boot process and
reads from the SD-card, but then hangs with the LEDs showing
0x84.
Maybe I didn't do it correct, I instantiated the ODDR2
buffer directly at the top module and modified the DCM
instantiation to create the clk90 clock.
Here is the code, can you look it over and see if this is
what you had in mind or if something is wrong:
DCM
#(.CLKFX_MULTIPLY(3), .CLKIN_DIVIDE_BY_2("TRUE"),
.CLKIN_PERIOD(20.000))
dcm(.CLKIN(CLK50M), .CLKFB(clk), .RST(1'b0),
.PSEN(1'b0),
.PSINCDEC(1'b0), .PSCLK(1'b0), .DSSEN(1'b0),
.CLKFX(pclk), .CLK0(clk),
.CLK90(clk90));
ODDR2 #(.INIT(1'b1))
oddr2(.Q(wr_enable), .C0(clk90), .C1(~clk90), .CE(1'b1),
.D0(1'b1),
.D1(~wr), .R(1'b0), .S(1'b0));
assign SRwe =
wr_enable;
wr is the active-high write signal from the RISC5 CPU, and
SRwe is the short active-low write-enable signal to the
SRAM.
Just to recap, this is the code I used to generate the short
write pulse, using a 2x clk instead. This version seems to
run fine:
reg wr_enable;
DCM
#(.CLKFX_MULTIPLY(3), .CLKFX_DIVIDE(2), .CLKDV_DIVIDE(2),
.CLKIN_PERIOD(20.000))
dcm(.CLKIN(CLK50M), .CLKFB(clk2x), .RST(1'b0),
.PSEN(1'b0),
.PSINCDEC(1'b0), .PSCLK(1'b0), .DSSEN(1'b0),
.CLKFX(pclk), .CLKDV(clk), .CLK0(clk2x));
always @(negedge clk2x)
wr_enable <= wr & ~wr_enable;
assign SRwe = ~wr_enable;
Any idea what's wrong?
Magnus
On 2/19/2016 9:58 AM, Walter Gallegos wrote:
Let us concentrate in the problem...
How to generate an output pulse shorter than clock period?
You can make a pulse shorter with help of DCM and DDR ( dual
data rate output registers ) see the simulation capture

clk25f90 is the DCM clock output with 90° phase shift.
The VHDL code is : ( without DCM instantiation )
ENTITY PulseShaper IS
PORT (CLK25F90 : IN STD_LOGIC;
RESET : IN STD_LOGIC;
WE : IN STD_LOGIC;
WESRAM : OUT STD_LOGIC
);
END PulseShaper;
ARCHITECTURE RTL OF PulseShaper IS
CONSTANT zero : STD_LOGIC := '0';
CONSTANT one : STD_LOGIC := '1';
SIGNAL clk90n: STD_LOGIC;
BEGIN
clk90n <= NOT(CLK25F90); -- This is valid because the
tool use the clock inverter available in IOB
Dly : ODDR2
PORT MAP (
Q => WESRAM,
C0 => CLK25F90,
C1 => clk90n,
CE => one,
D0 => one,
D1 => WE,
R => zero,
S => zero
);
END RTL;
Someone know if exist a FPGA testbench for RISC5 ?
Regards,
Walter