mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-24 11:11:02 -07:00
in turn allows the sequencer to lose less time --- this gets the effective clock rate down to about 1.01us. However we still seem to lose the last sector on 18-sector disks and there are some disk reads so something is still wrong.
170 lines
7.1 KiB
Verilog
170 lines
7.1 KiB
Verilog
|
|
//`#start header` -- edit after this line, do not edit this line
|
|
`include "cypress.v"
|
|
//`#end` -- edit above this line, do not edit this line
|
|
// Generated on 11/16/2017 at 15:44
|
|
// Component: FIFOout
|
|
module FIFOout (
|
|
input req,
|
|
input clk,
|
|
output [7:0] d,
|
|
output drq,
|
|
output empty,
|
|
output ack
|
|
);
|
|
|
|
//`#start body` -- edit after this line, do not edit this line
|
|
|
|
/* Reads from the FIFO are done based on the FIFO being not empty. */
|
|
|
|
wire [7:0] po;
|
|
assign d = po;
|
|
|
|
localparam STATE_WAITFORREQ = 0;
|
|
localparam STATE_READFROMFIFO = 1;
|
|
localparam STATE_WAITFORNREQ = 2;
|
|
|
|
reg [1:0] state;
|
|
wire readfromfifo;
|
|
|
|
assign ack = (state == STATE_WAITFORNREQ);
|
|
assign readfromfifo = (state == STATE_READFROMFIFO);
|
|
|
|
always @(posedge clk)
|
|
begin
|
|
case (state)
|
|
/* opcode is not valid; req is low; wait for req to go high. */
|
|
STATE_WAITFORREQ:
|
|
begin
|
|
if (!empty && req)
|
|
state <= STATE_READFROMFIFO;
|
|
end
|
|
|
|
/* Fetch a single value from the FIFO. */
|
|
STATE_READFROMFIFO:
|
|
state <= STATE_WAITFORNREQ;
|
|
|
|
/* opcode is valid; ack is high. Wait for req to go low. */
|
|
STATE_WAITFORNREQ:
|
|
if (!req)
|
|
state <= STATE_WAITFORREQ;
|
|
endcase
|
|
end
|
|
|
|
cy_psoc3_dp #(.cy_dpconfig(
|
|
{
|
|
`CS_ALU_OP_PASS, `CS_SRCA_A0, `CS_SRCB_D0,
|
|
`CS_SHFT_OP_PASS, `CS_A0_SRC_NONE, `CS_A1_SRC_NONE,
|
|
`CS_FE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`CS_SRCB_D0,
|
|
`CS_SHFT_OP_PASS, `CS_A0_SRC_NONE, `CS_A1_SRC_NONE,
|
|
`CS_FEEDBACK_DSBL, `CS_CI_SEL_CFGA, `CS_SI_SEL_CFGA,
|
|
`CS_CMP_SEL_CFGA, /*CFGRAM6: */
|
|
`CS_ALU_OP_PASS, `CS_SRCA_A0, `CS_SRCB_D0,
|
|
`CS_SHFT_OP_PASS, `CS_A0_SRC_NONE, `CS_A1_SRC_NONE,
|
|
`CS_FEEDBACK_DSBL, `CS_CI_SEL_CFGA, `CS_SI_SEL_CFGA,
|
|
`CS_CMP_SEL_CFGA, /*CFGRAM7: */
|
|
8'hFF, 8'h00, /*CFG9: */
|
|
8'hFF, 8'hFF, /*CFG11-10: */
|
|
`SC_CMPB_A1_D1, `SC_CMPA_A1_D1, `SC_CI_B_ARITH,
|
|
`SC_CI_A_ARITH, `SC_C1_MASK_DSBL, `SC_C0_MASK_DSBL,
|
|
`SC_A_MASK_DSBL, `SC_DEF_SI_0, `SC_SI_B_DEFSI,
|
|
`SC_SI_A_DEFSI, /*CFG13-12: */
|
|
`SC_A0_SRC_ACC, `SC_SHIFT_SL, 1'h0,
|
|
1'h0, `SC_FIFO1_BUS, `SC_FIFO0_BUS,
|
|
`SC_MSB_DSBL, `SC_MSB_BIT0, `SC_MSB_NOCHN,
|
|
`SC_FB_NOCHN, `SC_CMP1_NOCHN,
|
|
`SC_CMP0_NOCHN, /*CFG15-14: */
|
|
10'h00, `SC_FIFO_CLK__DP,`SC_FIFO_CAP_AX,
|
|
`SC_FIFO_LEVEL,`SC_FIFO_ASYNC,`SC_EXTCRC_DSBL,
|
|
`SC_WRK16CAT_DSBL /*CFG17-16: */
|
|
}
|
|
)) dp(
|
|
/* input */ .reset(1'b0),
|
|
/* input */ .clk(clk),
|
|
/* input [02:00] */ .cs_addr({2'b0, readfromfifo}),
|
|
/* input */ .route_si(1'b0),
|
|
/* input */ .route_ci(1'b0),
|
|
/* input */ .f0_load(1'b0),
|
|
/* input */ .f1_load(1'b0),
|
|
/* input */ .d0_load(1'b0),
|
|
/* input */ .d1_load(1'b0),
|
|
/* output */ .ce0(),
|
|
/* output */ .cl0(),
|
|
/* output */ .z0(),
|
|
/* output */ .ff0(),
|
|
/* output */ .ce1(),
|
|
/* output */ .cl1(),
|
|
/* output */ .z1(),
|
|
/* output */ .ff1(),
|
|
/* output */ .ov_msb(),
|
|
/* output */ .co_msb(),
|
|
/* output */ .cmsb(),
|
|
/* output */ .so(),
|
|
/* output */ .f0_bus_stat(drq), // not full
|
|
/* output */ .f0_blk_stat(empty), // empty
|
|
/* output */ .f1_bus_stat(),
|
|
/* output */ .f1_blk_stat(),
|
|
|
|
/* input */ .ci(1'b0), // Carry in from previous stage
|
|
/* output */ .co(),// Carry out to next stage
|
|
/* input */ .sir(1'b0), // Shift in from right side
|
|
/* output */ .sor(), // Shift out to right side
|
|
/* input */ .sil(1'b0), // Shift in from left side
|
|
/* output */ .sol(), // Shift out to left side
|
|
/* input */ .msbi(1'b0), // MSB chain in
|
|
/* output */ .msbo(), // MSB chain out
|
|
/* input [01:00] */ .cei(2'b0), // Compare equal in from prev stage
|
|
/* output [01:00] */ .ceo(), // Compare equal out to next stage
|
|
/* input [01:00] */ .cli(2'b0), // Compare less than in from prv stage
|
|
/* output [01:00] */ .clo(), // Compare less than out to next stage
|
|
/* input [01:00] */ .zi(2'b0), // Zero detect in from previous stage
|
|
/* output [01:00] */ .zo(), // Zero detect out to next stage
|
|
/* input [01:00] */ .fi(2'b0), // 0xFF detect in from previous stage
|
|
/* output [01:00] */ .fo(), // 0xFF detect out to next stage
|
|
/* input [01:00] */ .capi(2'b0), // Software capture from previous stage
|
|
/* output [01:00] */ .capo(), // Software capture to next stage
|
|
/* input */ .cfbi(1'b0), // CRC Feedback in from previous stage
|
|
/* output */ .cfbo(), // CRC Feedback out to next stage
|
|
/* input [07:00] */ .pi(8'b0), // Parallel data port
|
|
/* output [07:00] */ .po(po) // Parallel data port
|
|
);
|
|
|
|
//`#end` -- edit above this line, do not edit this line
|
|
endmodule
|
|
//`#start footer` -- edit after this line, do not edit this line
|
|
//`#end` -- edit above this line, do not edit this line
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|