URL
https://opencores.org/ocsvn/cxd9731/cxd9731/trunk
Subversion Repositories cxd9731
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 4 to Rev 5
- ↔ Reverse comparison
Rev 4 → Rev 5
/cxd9731/CRC_CAL.v
0,0 → 1,49
`timescale 1ns / 1ps |
////////////////////////////////////////////////////////////////////////////////// |
// Company: |
// Engineer: |
// |
// Create Date: 17:46:11 02/27/2009 |
// Design Name: |
// Module Name: CRC_CAL |
// Project Name: |
// Target Devices: |
// Tool versions: |
// Description: |
// |
// Dependencies: |
// |
// Revision: |
// Revision 0.01 - File Created |
// Additional Comments: |
// |
////////////////////////////////////////////////////////////////////////////////// |
module CRC_CAL(CLK4, D, CRC_ARM, CRC_ENB, CRC_Q); |
input CLK4; |
input [15:0] D; |
input CRC_ARM; |
input CRC_ENB; |
output [15:0] CRC_Q; |
|
wire [15:0] R_D; |
reg [15:0] R_Q; |
|
|
// CRC combination logic block |
CRC_CL CF( .D(D), // one input is the data block |
.C(R_Q), // other input is the register feed back |
.Q(R_D) // result feed into the data register data port |
); |
|
assign CRC_Q = R_Q; |
|
|
always @(posedge CLK4) begin //negedge |
if(CRC_ARM == 1'b0) begin |
R_Q <= 16'h4ABA; |
end else if(CRC_ENB == 1'b1) begin |
R_Q <= R_D; // clock the data into the port |
end |
end |
|
endmodule |
/cxd9731/CRC_CL.v
0,0 → 1,65
`timescale 1ns / 1ps |
////////////////////////////////////////////////////////////////////////////////// |
// Company: |
// Engineer: |
// |
// Create Date: 15:32:40 03/04/2009 |
// Design Name: |
// Module Name: CRC_CL |
// Project Name: |
// Target Devices: |
// Tool versions: |
// Description: |
// |
// Dependencies: |
// |
// Revision: |
// Revision 0.01 - File Created |
// Additional Comments: |
// |
////////////////////////////////////////////////////////////////////////////////// |
module CRC_CL( |
input [15:0] D, |
input [15:0] C, |
output [15:0] Q |
); |
|
wire [16:1] f; // internal wire |
// The polynomial is |
// G(X) = X16 + X12 + X5 + 1 |
|
assign f[1] = D[0] ^ C[15]; |
assign f[2] = D[1] ^ C[14]; |
assign f[3] = D[2] ^ C[13]; |
assign f[4] = D[3] ^ C[12]; |
assign f[5] = D[4] ^ C[11] ^ f[1]; |
assign f[6] = D[5] ^ C[10] ^ f[2]; |
assign f[7] = D[6] ^ C[9] ^ f[3]; |
assign f[8] = D[7] ^ C[8] ^ f[4]; |
assign f[9] = D[8] ^ C[7] ^ f[5]; |
assign f[10] = D[9] ^ C[6] ^ f[6]; |
assign f[11] = D[10] ^ C[5] ^ f[7]; |
assign f[12] = D[11] ^ C[4] ^ f[8] ^ f[1]; |
assign f[13] = D[12] ^ C[3] ^ f[9] ^ f[2]; |
assign f[14] = D[13] ^ C[2] ^ f[10] ^ f[3]; |
assign f[15] = D[14] ^ C[1] ^ f[11] ^ f[4]; |
assign f[16] = D[15] ^ C[0] ^ f[12] ^ f[5]; |
|
assign Q[0] = f[16]; |
assign Q[1] = f[15]; |
assign Q[2] = f[14]; |
assign Q[3] = f[13]; |
assign Q[4] = f[12]; |
assign Q[5] = f[11] ^ f[16]; |
assign Q[6] = f[10] ^ f[15]; |
assign Q[7] = f[9] ^ f[14]; |
assign Q[8] = f[8] ^ f[13]; |
assign Q[9] = f[7] ^ f[12]; |
assign Q[10] = f[6] ^ f[11]; |
assign Q[11] = f[5] ^ f[10]; |
assign Q[12] = f[4] ^ f[9] ^ f[16]; |
assign Q[13] = f[3] ^ f[8] ^ f[15]; |
assign Q[14] = f[2] ^ f[7] ^ f[14]; |
assign Q[15] = f[1] ^ f[6] ^ f[13]; |
|
endmodule |
/cxd9731/CheckDNA.v
0,0 → 1,368
`timescale 1ns / 1ps |
////////////////////////////////////////////////////////////////////////////////// |
// Company: |
// Engineer: |
// |
// Create Date: 19:53:31 03/10/2009 |
// Design Name: |
// Module Name: CheckDNA |
// Project Name: |
// Target Devices: |
// Tool versions: |
// Description: |
// |
// Dependencies: |
// |
// Revision: |
// Revision 0.01 - File Created |
// Additional Comments: |
// |
////////////////////////////////////////////////////////////////////////////////// |
module CheckDNA( |
input clk4, |
input reset, |
input [63:0] DNA_64, // The DNA code |
input dna_valid, |
|
input [15:0] ROM_Data, // ROM data |
input IDE_CS, // chip select killer signal |
output reg DNA_ENA, // the enable signal to reduce power consumption |
output reg DNA_REG, // enable output register for faster RAM access |
output reg [9:0] DNA_Addr, // RAM address |
|
output dna_pass, // result of check |
output [3:0] KILL // Killing signals |
); |
|
// Result of check |
// DNA_FailR[0] = set to 1 if (XOR check sum is not zero) or (DNA address in [1018-1022] does not match with local DNA) |
// DNA_FailR[1] = set to 1 if {DNA address in [1018-1022] not match with local DNA) |
// DNA_FailR[2] = set to 1 if ( |
// DNA_FailR[3] = set to 1 if |
// parameter no_of_ran_no = 1021; // for server1104 |
parameter no_of_ran_no = 1016; // For Server1108 |
|
reg [15:0] xor_check; // overall check key of the XOR |
reg [63:0] dna; // local dna code |
reg [9:0] L_Addr; // the addres of the check code |
reg [15:0] check; // the content of the check code |
reg multi_ce; // enable the multiplier signal |
reg [4:0] dna_gen_st; // dna state machine |
reg [3:0] DNA_FailR; // dna failing reigster |
|
parameter DcIdle = 5'b00000; |
parameter Dc01 = 5'b00001; |
parameter Dc02 = 5'b00010; |
parameter Dc03 = 5'b00011; |
parameter Dc04 = 5'b00100; |
parameter Dc10 = 5'b00101; |
parameter Dc11 = 5'b00110; |
parameter Dc12 = 5'b00111; |
parameter Dc13 = 5'b01000; |
parameter Dc14 = 5'b01001; |
parameter Dc20 = 5'b01010; |
parameter Dc21 = 5'b01011; |
parameter Dc22 = 5'b01100; |
parameter Dc23 = 5'b01101; |
parameter Dc24 = 5'b01110; |
parameter Dc25 = 5'b01111; |
parameter Dc26 = 5'b10000; |
parameter Dc27 = 5'b10001; |
parameter Dc28 = 5'b10010; |
parameter Dc29 = 5'b10011; |
parameter Dc30 = 5'b10100; |
parameter Dc31 = 5'b10101; |
parameter Dc32 = 5'b10110; |
parameter Dc33 = 5'b10111; |
parameter Dc34 = 5'b11000; |
parameter Dc35 = 5'b11001; |
parameter Dc90 = 5'b11010; |
parameter Dc91 = 5'b11011; |
parameter Dc92 = 5'b11100; |
|
reg [15:0] multi_a; |
reg [15:0] multi_b; |
reg [15:0] Simp_XOR; // simple XOR register |
reg FinishCheck; // flip flop to show checking is finished |
wire [15:0] multi_p; // output of register |
wire [15:0] ma; // input feed of multi_a |
wire [15:0] mb; // input feed of multi_b |
wire K_WINDOW; // wire key window |
|
/////////////////////////////////////////////////////////////// |
|
multi_16 inst_multi_16 ( |
.ce(multi_ce), |
.clk(clk4), |
.a(multi_a), // Bus [15 : 0] |
.b(multi_b), // Bus [15 : 0] |
.p(multi_p)); // Bus [15 : 0] |
|
// Server1104 = algorithm |
//Multi_A = XOR_REG( DNA_64(18,24) + DNA_64(26,28) + DNA_64(30,32) + DNA_64(33,39)), |
// Multi_P(0,6) + Multi_P(8, 10) + Multi_P(6, 8) + Multi_P(10, 16)); |
//Multi_B = XOR_REG(ROM_Data(0,16), DNA_64(48,64)); |
//assign ma[15:10] = multi_p[15:10] ^ dna[45:40]; // Multi_P(0,6) ^ DNA_64(18,24) |
//assign ma[9:8] = multi_p[7:6] ^ dna[37:36]; // Multi_P(8,10) ^ DNA_64(26,28) |
//assign ma[7:6] = multi_p[9:8] ^ dna[33:32]; // Multi_P(6,8) ^ DNA_64(30,32) |
//assign ma[5:0] = multi_p[5:0] ^ dna[30:25]; // Multi_P(10,16) ^ DNA_64(33,39) |
//assign mb[15:0] = ROM_Data[15:0] ^ dna[15:0]; // ROM_Data(0,16) ^ DNA_64(48,64) |
|
// Server1108 = algorithm |
//Multi_A = XOR_REG( DNA_64(16,22) + DNA_64(26,28) + DNA_64(30,32) + DNA_64(33,39)), |
// Multi_P(0,6) + Multi_P(8, 10) + Multi_P(6, 8) + Multi_P(10, 16)); |
//Multi_B = XOR_REG(ROM_Data(0,16), DNA_64(44,60)); |
assign ma[15:10] = multi_p[15:10] ^ dna[47:42]; // Multi_P(0,6) ^ DNA_64(16,22) |
assign ma[9:8] = multi_p[7:6] ^ dna[37:36]; // Multi_P(8,10) ^ DNA_64(26,28) |
assign ma[7:6] = multi_p[9:8] ^ dna[33:32]; // Multi_P(6,8) ^ DNA_64(30,32) |
assign ma[5:0] = multi_p[5:0] ^ dna[30:25]; // Multi_P(10,16) ^ DNA_64(33,39) |
assign mb[15:0] = ROM_Data[15:0] ^ dna[20:4]; // ROM_Data(0,16) ^ DNA_64(44,60) |
|
/////////////////////// Killing signals //////////////////// |
assign KILL[0] = DNA_FailR[0]; // Fail register to output the signal |
assign KILL[1] = ~DNA_FailR[0] & DNA_FailR[1] & K_WINDOW & Simp_XOR[2]; // If someone modify the Fail 0, then we create new fail for them |
assign KILL[2] = ~DNA_FailR[0] & ~DNA_FailR[1] & DNA_FailR[2] & K_WINDOW & ~Simp_XOR[2]; |
assign KILL[3] = ~DNA_FailR[0] & ~DNA_FailR[1] & DNA_FailR[3] & K_WINDOW & Simp_XOR[2]; |
assign K_WINDOW = Simp_XOR[9] & Simp_XOR[8] & ~Simp_XOR[7] & Simp_XOR[6] & ~Simp_XOR[5] & ~Simp_XOR[3]; |
assign dna_pass = FinishCheck & ~DNA_FailR[3] & ~DNA_FailR[2] & ~DNA_FailR[1] & ~DNA_FailR[0]; |
|
always @(posedge clk4) begin |
if(reset) begin |
DNA_Addr <= 10'b00_0000_0000; // address of ROM_Data |
L_Addr <= 10'b00_0000_0000; // address of check_code |
xor_check <= 16'b0000_0000_0000_0000; // the XOR A bus check code |
multi_a <= 16'b0000_0000_0000_0000; // the two multipliers check code |
multi_b <= 16'b0000_0000_0000_0000; // the two multipliers bus check code |
Simp_XOR <= 16'b0000_0000_0000_0000; // simple XOR register |
DNA_FailR <= 4'b0000; // clear the fail register |
FinishCheck <= 1'b0; // clear the check phase |
DNA_ENA <= 1'b0; |
DNA_REG <= 1'b0; |
multi_ce <= 1'b0; |
dna_gen_st <= DcIdle; // start in the idle state |
end else begin |
case(dna_gen_st) |
//// ===== state 0, wait until dna code is valid ============ |
//// Formulate a dna_check_key to combat zero code attack |
DcIdle : begin |
if(dna_valid == 1'b1) begin |
dna_gen_st <= Dc01; |
end |
end |
Dc01 : begin |
DNA_ENA <= 1'b1; // enable reading the ROM |
multi_ce <= 1'b1; // flush the multiplier with 0s |
dna <= DNA_64; // clock in the main register |
dna_gen_st <= Dc02; |
end |
Dc02 : begin |
DNA_ENA <= 1'b0; // disable reading the ROM |
DNA_REG <= 1'b1; // fetch first ROM data to bus |
dna_gen_st <= Dc03; |
end |
Dc03 : begin |
DNA_REG <= 1'b0; |
dna_gen_st <= Dc04; |
end |
Dc04 : begin |
multi_ce <= 1'b0; // multiplier completely flushed |
multi_a[15:0] <= ma[15:0]; |
multi_b[15:0] <= mb[15:0]; |
L_Addr[9] <= ~mb[10]; // mult address is stable now |
L_Addr[8:0] <= mb[10:2]; // check address is between 256-767 |
dna_gen_st <= Dc10; // go to the main loop |
end |
//// ====== Check on the data block =========== |
Dc10: begin |
DNA_REG <= 1'b0; |
dna_gen_st <= Dc11; // next state |
end |
Dc11: begin |
multi_ce <= 1'b1; |
multi_a[15:0] <= ma[15:0]; // activate the multipliers |
multi_b[15:0] <= mb[15:0]; |
dna_gen_st <= Dc12; // next state |
end |
Dc12: begin |
dna[63:1] <= dna[62:0]; |
dna[0] <= dna[63] ^ ROM_Data[1]; // bitwise rotate the data |
DNA_ENA <= 1'b0; // save power for the ROM |
if (DNA_Addr == L_Addr) check <= multi_a; // store up the value of check instance |
DNA_Addr <= DNA_Addr + 1; // proceed to next address |
Simp_XOR[15:0] <= Simp_XOR[15:0] ^ ROM_Data[15:0]; // mask the registers |
xor_check <= xor_check ^ multi_b; // the xor algorithm is base on dna XOR ROM_Data |
dna_gen_st <= Dc13; |
end |
Dc13: begin |
DNA_ENA <= 1'b1; // enable back the ROM |
dna_gen_st <= Dc14; |
end |
Dc14: begin |
DNA_ENA <= 1'b0; // disable ROM access |
DNA_REG <= 1'b1; // enable back the ROM and reg |
if (DNA_Addr == no_of_ran_no) begin |
DNA_Addr <= DNA_Addr + 1; // advance the address |
dna_gen_st <= Dc20; // go to the result phase |
end else begin |
dna_gen_st <= Dc10; // loop back for new computation |
end |
end |
//// ====================================================== |
Dc20 : begin // DNA_Addr = 1016 |
multi_ce <= 1'b0; // save some power |
DNA_REG <= 1'b0; // lock down the reg |
DNA_ENA <= 1'b1; // clock out the data to register side |
dna_gen_st <= Dc21; |
end |
Dc21 : begin |
Simp_XOR[15:0] <= Simp_XOR[15:0] ^ ROM_Data[15:0]; // mask the registers |
if (multi_a != ROM_Data) begin |
DNA_FailR[3] <= 1'b1; // 3rd level fail |
end |
DNA_REG <= 1'b1; // clock out the data to compare |
DNA_ENA <= 1'b0; // lock down the RAM area |
DNA_Addr <= DNA_Addr+1; // pipe the new address 1017 to RAM |
dna_gen_st <= Dc22; |
end |
Dc22 : begin // DNA_Addr = 1017 |
DNA_REG <= 1'b0; // lock down the reg |
DNA_ENA <= 1'b1; // clock out the data to register side |
dna_gen_st <= Dc23; |
end |
Dc23 : begin |
Simp_XOR[15:0] <= Simp_XOR[15:0] ^ ROM_Data[15:0]; // mask the registers |
if (xor_check != ROM_Data) begin |
DNA_FailR[2] <= 1'b1; // 2nd level fail |
end |
DNA_REG <= 1'b1; // clock out the data to compare |
DNA_ENA <= 1'b0; // lock down the RAM area |
DNA_Addr <= DNA_Addr+1; // pipe the new address to RAM |
dna_gen_st <= Dc24; |
end |
//////// |
Dc24 : begin // DNA_Addr = 1018 |
DNA_REG <= 1'b0; // lock down the reg |
DNA_ENA <= 1'b1; |
dna_gen_st <= Dc25; |
end |
Dc25 : begin // DNA_Addr = 1018 |
Simp_XOR[15:0] <= Simp_XOR[15:0] ^ ROM_Data[15:0]; // mask the registers |
if (check != ROM_Data) begin |
DNA_FailR[1] <= 1'b1; // set the general fail |
end |
DNA_REG <= 1'b1; // clock out the data to compare |
DNA_ENA <= 1'b0; // lock down the RAM area |
DNA_Addr <= DNA_Addr+1; // pipe the new address to RAM |
dna_gen_st <= Dc26; |
end |
////////// |
Dc26 : begin // DNA_Addr = 1019 |
DNA_REG <= 1'b0; // lock down the reg |
DNA_ENA <= 1'b1; |
dna_gen_st <= Dc27; |
end |
Dc27 : begin // DNA_Addr = 1019 |
Simp_XOR[15:0] <= Simp_XOR[15:0] ^ ROM_Data[15:0]; // mask the registers |
if (DNA_64[63:48] != ROM_Data[15:0]) begin |
DNA_FailR[0] <= 1'b1; |
end |
DNA_REG <= 1'b1; // clock out the data to compare |
DNA_ENA <= 1'b0; // lock down the RAM area |
DNA_Addr <= DNA_Addr+1; // pipe the new address to RAM |
dna_gen_st <= Dc28; |
end |
////////// |
Dc28 : begin // DNA_Addr = 1020 |
DNA_REG <= 1'b0; // lock down the reg |
DNA_ENA <= 1'b1; |
dna_gen_st <= Dc29; |
end |
Dc29 : begin // DNA_Addr = 1020 |
Simp_XOR[15:0] <= Simp_XOR[15:0] ^ ROM_Data[15:0]; // mask the registers |
if (DNA_64[47:32] != ROM_Data[15:0]) begin |
DNA_FailR[0] <= 1'b1; |
end |
DNA_REG <= 1'b1; // clock out the data to compare |
DNA_ENA <= 1'b0; // lock down the RAM area |
DNA_Addr <= DNA_Addr+1; // pipe the new address to RAM |
dna_gen_st <= Dc30; |
end |
////////// |
Dc30 : begin // DNA_Addr = 1021 |
DNA_REG <= 1'b0; // lock down the reg |
DNA_ENA <= 1'b1; |
dna_gen_st <= Dc31; |
end |
Dc31 : begin // DNA_Addr = 1021 |
Simp_XOR[15:0] <= Simp_XOR[15:0] ^ ROM_Data[15:0]; // mask the registers |
if (DNA_64[31:16] != ROM_Data[15:0]) begin |
DNA_FailR[0] <= 1'b1; |
end |
DNA_REG <= 1'b1; // clock out the data to compare |
DNA_ENA <= 1'b0; // lock down the RAM area |
DNA_Addr <= DNA_Addr+1; // pipe the new address to RAM |
dna_gen_st <= Dc32; |
end |
////////// |
Dc32 : begin // DNA_Addr = 1022 |
DNA_REG <= 1'b0; // lock down the reg |
DNA_ENA <= 1'b1; // read from ram |
dna_gen_st <= Dc33; |
end |
Dc33 : begin // DNA_Addr = 1022 |
Simp_XOR[15:0] <= Simp_XOR[15:0] ^ ROM_Data[15:0]; // mask the registers |
if (DNA_64[15:0] != ROM_Data[15:0]) begin |
DNA_FailR[0] <= 1'b1; |
end |
DNA_REG <= 1'b1; // clock out the data to compare |
DNA_ENA <= 1'b0; // lock down the RAM area |
// DNA_Addr <= DNA_Addr+1; // pipe the new address to RAM |
dna_gen_st <= Dc34; |
end |
////////// |
Dc34 : begin // DNA_Addr = 1023 |
DNA_REG <= 1'b0; // lock down the reg |
// DNA_ENA <= 1'b1; |
dna_gen_st <= Dc35; |
end |
Dc35 : begin // DNA_Addr = 1023 |
if (Simp_XOR[15:0] != ROM_Data[15:0]) begin |
DNA_FailR[0] <= 1'b1; |
end |
// DNA_REG <= 1'b1; // clock out the data to compare |
// DNA_ENA <= 1'b0; // lock down the RAM area |
// DNA_Addr <= DNA_Addr+1; // pipe the new address to RAM |
FinishCheck <= 1'b1; // exit the check phase |
dna_gen_st <= Dc90; |
end |
///// ============= result found loop here forever |
Dc90: begin |
if (IDE_CS == 1'b0) begin |
dna_gen_st <= Dc91; |
end else begin |
dna_gen_st <= Dc90; // loop here if CS is 1 |
end |
end |
////// |
Dc91: begin |
Simp_XOR <= Simp_XOR + 1; // increment the Simp_XOR to generate the internal kill signal |
dna_gen_st <= Dc92; |
end |
////// |
Dc92: begin |
if (IDE_CS == 1'b1) begin |
dna_gen_st <= Dc90; // if 1 goto next state |
end else begin |
dna_gen_st <= Dc92; // loop here if CS is 0 |
end |
end |
|
//// =================================== |
default : begin |
dna_gen_st <= DcIdle; // loop back to idle |
end |
//// ================================= |
endcase |
end /// reset |
end //// clock |
endmodule |
/cxd9731/D_RAM.v
0,0 → 1,208
`timescale 1ns / 1ps |
////////////////////////////////////////////////////////////////////////////////// |
// Company: |
// Engineer: |
// |
// Create Date: 10:31:51 12/08/2008 |
// Design Name: |
// Module Name: DMA_RAM - Behavioral |
// Project Name: |
// Target Devices: |
// Tool versions: |
// Description: |
// |
// Dependencies: |
// |
// Revision: |
// Revision 0.01 - File Created |
// Additional Comments: |
// |
////////////////////////////////////////////////////////////////////////////////// |
|
|
module D_RAM( |
input CLK4 , |
input DMA_ARM , |
input PS2WrIDE , // High if PS2 DMA write to IDE bus |
//// ===== |
input CRC_ARM , |
input CRC_ENB , // the enable for the CRC circuit |
output [15:0] CRC_Q , |
//// ===== |
output [3:0] BufSize , // data size in 512 bytes ready |
output BufEmpty , // set when no words in the FIFO buffer |
//// ===== |
input [15:0] DInA , |
output [15:0] DOutA , |
input [31:0] DInB , |
output [31:0] DOutB , |
//// ===== |
output PA_HvSpace , |
output PA_OD_Rdy , // some data availabe for output from Port A |
output PA_AlmostFull , // set when buffer has only 4 words left |
output PA_Empty, // set when buffer is all drained |
output PA_Full, // Register is full. |
output WithinABlock , |
output reg A0, // A0 to put signal to IDE_DMA |
input HWOE, // select high order word to output |
input RegEA, |
input IncAddrA , |
input EnbA , // enable and the control signal |
input WrA , |
//// ===== |
output PB_HvSpace , |
output PB_OD_Rdy , // some data availabe for output from Port B |
output WithinBBlock , // high if (AddrB[6] | AddrB[5]) = 1 |
output BBurstEnd , // high if AddrB = xxxx11111 = 1F |
input IncAddrB , |
input RegEB , |
input EnbB , |
input WrB |
); |
|
|
////////////////////////////////////////////////////// |
wire R0Enb,R1Enb,R0Wr,R1Wr,RegEA0,RegEA1; |
wire [15:0] DOutA0,DOutA1,DInBL,DInBH,DOutBL,DOutBH; |
reg [9:0] AddrA,AddrB; |
reg [3:0] Page; |
wire IncPgA,IncPgB; |
wire PageNZ,PageZR; |
wire HvSpaceA,HvSpaceB; |
wire A_Zero,B_Zero; |
////-========================================================================= |
RAM1 RAM_Lo ( |
.clka (CLK4), |
.dina (DInA), // IDE side data bits |
.addra (AddrA), |
.ena (R0Enb), |
.wea (R0Wr), |
.regcea (RegEA0), |
.douta (DOutA0), |
// |
.clkb (CLK4), |
.dinb (DInBL), // PS2 side data bus |
.addrb (AddrB), |
.enb (EnbB), |
.regceb (RegEB), |
.web (WrB), |
.doutb (DOutBL) |
); |
//// ========================================= |
RAM1 RAM_Hi( |
.clka (CLK4), |
.dina (DInA), // IDE side data bits |
.addra (AddrA), |
.ena (R1Enb), |
.wea (R1Wr), |
.regcea (RegEA1), |
.douta (DOutA1), |
// |
.clkb (CLK4), |
.dinb (DInBH), // PS2 side data bus |
.addrb (AddrB), |
.enb (EnbB), |
.regceb (RegEB), |
.web (WrB), |
.doutb (DOutBH) |
); |
//// ========================================= |
|
CRC_CAL CRC( |
.CLK4 (CLK4), // same as RAM clock |
.D (DInA), //- same as the RAM data |
.CRC_ARM (CRC_ARM), //- from the controller unit |
.CRC_ENB (CRC_ENB), |
.CRC_Q (CRC_Q) |
); |
//-============================================================================= |
|
//-==== Connect the RAM |
assign DOutA[15:0] = (HWOE == 1'b1) ? DOutA1[15:0] : DOutA0[15:0]; |
assign DOutB[31:16] = DOutBH[15:0]; |
assign DOutB[15:0] = DOutBL[15:0]; |
assign DInBH[15:0] = DInB[31:16]; |
assign DInBL[15:0] = DInB[15:0]; |
assign R0Enb = EnbA & ~A0; |
assign R1Enb = EnbA & A0; |
assign R0Wr = WrA & ~A0; |
assign R1Wr = WrA & A0; |
assign RegEA0 = RegEA & ~A0; |
assign RegEA1 = RegEA & A0; |
//// |
//// = the page counter //// |
assign IncPgA = IncAddrA & AddrA[6] & AddrA[5] & AddrA[4] & AddrA[3] & AddrA[2] & AddrA[1] & AddrA[0] & A0; |
assign IncPgB = IncAddrB & AddrB[6] & AddrB[5] & AddrB[4] & AddrB[3] & AddrB[2] & AddrB[1] & AddrB[0]; |
assign BufEmpty = PageZR & A_Zero & B_Zero; |
////////-======================================================= |
assign HvSpaceA = ~Page[3] & ( ~(Page[2] & Page[1] & Page[0]) | A_Zero ); |
assign HvSpaceB = ~Page[3] & ( ~(Page[2] & Page[1] & Page[0]) | B_Zero ); |
assign PageNZ = Page[3] | Page[2] | Page[1] | Page[0]; |
assign PageZR = ~(Page[3] | Page[2] | Page[1] | Page[0]); |
assign A_Zero = ~(AddrA[6] | AddrA[5] | AddrA[4] | AddrA[3] | AddrA[2] | AddrA[1] | AddrA[0]); |
assign PA_Empty = PageZR & A_Zero & ~A0; |
assign B_Zero = ~(AddrB[6] | AddrB[5] | AddrB[4] | AddrB[3] | AddrB[2] | AddrB[1] | AddrB[0]); |
|
assign PA_OD_Rdy = PageNZ; |
assign PA_HvSpace = HvSpaceA; // have 512 byte space at least |
assign PA_AlmostFull = Page[3] | (Page[2] & Page[1] & Page[0] & AddrA[6] & AddrA[5] & AddrA[4] & AddrA[3]); |
// PA_Full - a signal set high to indicate all buffer area is used up and until clear one page, should |
// not start DMA read into Port A |
// This signal will be high if incremented and will keep high until PortB dec it |
assign PA_Full = Page[3]; |
|
assign WithinABlock = AddrA[6] | AddrA[5] | AddrA[4] | AddrA[3] | AddrA[2] | AddrA[1] | AddrA[0] | A0; |
//// |
assign PB_OD_Rdy = PageNZ; // if there is more than one page of data |
assign PB_HvSpace = HvSpaceB; // if there is space in buffer |
assign WithinBBlock = AddrB[6] | AddrB[5] | AddrB[4] | AddrB[3] | AddrB[2] | AddrB[1] | AddrB[0]; |
assign BBurstEnd = AddrB[4] & AddrB[3] & AddrB[2] & AddrB[1] & AddrB[0]; // high if AddrB = xxxx11111 = 1F |
//////// |
assign BufSize[3:0] = Page[3:0]; |
|
////- ============================================================================ |
always @(posedge CLK4) begin |
if (DMA_ARM == 1'b0) |
AddrB <= 10'b00_0000_0000; |
else |
if(IncAddrB == 1'b1) |
AddrB <= AddrB + 1; |
end |
|
always @(posedge CLK4) begin |
if (DMA_ARM == 1'b0) begin |
AddrA <= 10'b00_0000_0000; |
A0 <= 1'b0; |
end else begin |
if(IncAddrA == 1'b1) begin |
if (A0 == 1'b1) begin |
AddrA <= AddrA + 1; |
A0 <= 1'b0; |
end else begin |
A0 <= 1'b1; |
end |
end |
end |
end |
|
always @(posedge CLK4) begin |
if (DMA_ARM == 1'b0) begin |
Page <= 4'b0000; |
end else begin |
if (PS2WrIDE == 1'b1) begin // PS2 writes to drive |
if (IncPgB == 1'b1) begin |
if (IncPgA == 1'b0) Page <= Page + 1; // buffer increase in size |
end else begin |
if (IncPgA == 1'b1) Page <= Page - 1; // buffer decrease in size |
end |
end else begin |
if (IncPgA == 1'b1) begin |
if (IncPgB == 1'b0) Page <= Page + 1; // buffer has increase in size |
end else begin |
if (IncPgB == 1'b1) Page <= Page - 1; // buffer decrease in size |
end |
end // PS2WrIDE |
end // DMA_ARM |
end // always |
|
endmodule |
/cxd9731/IDE_DMA.v
0,0 → 1,672
`timescale 1ns / 1ps |
////////////////////////////////////////////////////////////////////////////////// |
// Company: |
// Engineer: |
// |
// Create Date: 13:38:06 03/04/2009 |
// Design Name: |
// Module Name: IDE_DMA |
// Project Name: |
// Target Devices: |
// Tool versions: |
// Description: |
// |
// Dependencies: |
// |
// Revision: |
// Revision 0.01 - File Created |
// Additional Comments: |
// |
////////////////////////////////////////////////////////////////////////////////// |
|
//// Uncomment the following library declaration if instantiating |
//// any Xilinx primitives in this code. |
//library UNISIM; |
//use UNISIM.VComponents.all; |
|
module IDE_DMA( |
// output IDE_DMA_STATE : out std_logic_vector(15 downto 0); |
input CLK4 , |
input Phase3 , |
////// external pin interface |
output reg iDK , // DMA acknowledge output to harddisk |
input iDQ , // DMA request input from harddisk |
input SiRdy1 , // Sync ready signal |
input SiRdy2 , // Sync ready signal |
////// system signal |
input DMA_ARM , // extra signal to ARM the IDE DMA part |
input PS2WrIDE , // 1'b1 if direction is from PS2 to IDE |
input [2:0] UDMA , // the mode of the current transfer |
input [2:0] MDMA, |
output iDMARd , // active high signal to indicate DMA read |
output iDMAWr , // active high signal to indicate DMA write |
output reg iDMA_OE , // active high showing unit wishes to write bus |
output reg iD_245_In , // active high 245 read envelope ( 1 clock before OE and 1 clock after) |
output reg CRC_MUX , // inform system that need to drive the CRC Q to IDE bus |
output reg CRC_ARM , // a signal indicate that to clear the CRC state |
output reg CRC_ENB , // the enable for the CRC circuit |
////// interface the RAM buffer, DMA machine will act according to buffer |
input A0 , // address A0 |
input PA_Full , // high if PA is full, will be low only one block is cleared |
input PA_HvSpace , // there is empty space for Port A |
input PA_OD_Rdy , // some data availabe for output from Port A |
input WithinABlock , // set within A block |
input PA_AlmostFull , // stop if the buffer is almost full |
input PA_Empty , // high if PA is empty |
output IDE_DSTB, // high if we wish to strobe data |
output reg HWOE, // high to select high page to output |
output reg RegEA, |
output reg IncAddrA , |
output reg EnbA , // enable and the control signal |
output reg WrA |
); |
|
////// |
|
//// ================================ |
//////////////////////////////////////////////// |
// signals |
// NDMA : iDQ,iDK,iWr,iRd,iRDY |
// UDI : iDQ,iDK,STOP,HDMARDY,DSTROBE |
// UHO : iDQ,iDK,STOP,HSTROBE,DDMARDY |
////////////////////////////////////// |
reg HDMARDY,HSTROBE,STOP; |
reg ND_Rd,ND_Wr; |
|
wire NBrkOut; // wire to break out when buffer is empty |
reg iWait; |
wire UDMAC,MDMAC; |
reg ND_ARM; |
reg UHO_ARM; |
reg UDI_ARM; // the UDI enable wire |
reg ILatch; // the latch to control the data path for CRC calculation |
//// ======== |
wire Proceed; // wire to proceed to output data in buffer |
wire XiRdy1; // signal to indicate there is a transition |
|
parameter iIdle1 = 6'b00_0000; |
parameter iIdle2 = 6'b00_0001; |
parameter ND_2 = 6'b00_0010; |
parameter ND_3 = 6'b00_0011; |
parameter ND_4 = 6'b00_0100; |
parameter ND_5 = 6'b00_0101; |
parameter ND_6 = 6'b00_0110; |
parameter ND_7 = 6'b00_0111; |
parameter ND_8 = 6'b00_1000; |
parameter ND_9 = 6'b00_1001; |
parameter ND_A = 6'b00_1010; |
parameter ND_B = 6'b00_1011; |
parameter ND_C = 6'b00_1100; |
parameter Udi1 = 6'b01_0000; |
parameter Udi2 = 6'b01_0001; |
parameter Udi3 = 6'b01_0010; |
//parameter Udi4 = 6'b01_0011; |
parameter Udi10 = 6'b01_0100; |
parameter Udi11 = 6'b01_0101; |
parameter Udix1 = 6'b10_0001; |
parameter Udix2 = 6'b10_0010; |
parameter Udix3 = 6'b10_0011; |
parameter Udix4 = 6'b10_0100; |
parameter Udix5 = 6'b10_0101; |
parameter Udix6 = 6'b10_0110; |
parameter Uho_G = 6'b10_0111; |
parameter Uhx_0 = 6'b10_1000; |
parameter Uhx_1 = 6'b10_1001; |
parameter Uhx_2 = 6'b10_1010; |
parameter Uhx_3 = 6'b10_1011; |
parameter Uhx_4 = 6'b10_1100; |
parameter Uhx_5 = 6'b10_1101; |
parameter Uhx_6 = 6'b10_1110; |
// |
parameter Uho_0 = 6'b11_0000; |
parameter Uho_1 = 6'b11_0001; |
parameter Uho_2 = 6'b11_0010; |
parameter Uho_3 = 6'b11_0011; |
parameter Uho_4 = 6'b11_0100; |
parameter Uho_5 = 6'b11_0101; |
parameter Uho_6 = 6'b11_0110; |
parameter Uho_7 = 6'b11_0111; |
parameter Uho_8 = 6'b11_1000; |
parameter Uho_9 = 6'b11_1001; |
parameter Uho_A = 6'b11_1010; |
parameter Uho_B = 6'b11_1011; |
parameter Uho_C = 6'b11_1100; |
parameter Uho_D = 6'b11_1101; |
parameter Uho_E = 6'b11_1110; |
parameter Uho_F = 6'b11_1111; |
|
|
reg [5:0] iSTATE; |
reg [4:0] iCount; |
reg PipeEmpty; |
reg IDE_DSTB1; |
|
////- ============== test stubs |
//IDE_DMA_STATE(15 downto 7) <= "100000000"; // starts as 80xx |
//IDE_DMA_STATE(6 downto 0) <= Count(6 downto 0); |
//////////// ================== END OF TEST STUBBS ======================= |
|
|
|
////========================================================== |
//- Normal DMA only signal |
assign iDMAWr = (ND_ARM & ND_Wr) | ((UDI_ARM | UHO_ARM) & ~(STOP)); // the external DMA signal |
assign iDMARd = (ND_ARM & ND_Rd) | |
(UDI_ARM & HDMARDY) | |
(UHO_ARM & ~HSTROBE); |
|
// =============================================================================== |
/// signal to stop normal DMA machine |
// either 1/ iDQ is negated |
// or 2/ During Host Out and no data in FIFO |
// or 3/ During Drive In and FIFO is full |
assign NBrkOut = ~iDQ | (PS2WrIDE & PA_Empty) | (~PS2WrIDE & PA_Full); |
//// ============================================================================ |
|
//// =================================== |
assign UDMAC = (UDMA[2] | UDMA[1] | UDMA[0]) & ~(MDMAC); |
assign MDMAC = MDMA[2] | MDMA[1] | MDMA[0]; |
assign Proceed = PA_OD_Rdy | WithinABlock; // allow to output data when ready or we are in a transaction period |
assign XiRdy1 = SiRdy1 ^ SiRdy2; // an early edge signal, lock the data to RAM |
assign IDE_DSTB = (XiRdy1 & UDI_ARM) | ((UHO_ARM | ND_ARM) & ILatch ); |
|
always @(posedge CLK4) begin |
IDE_DSTB1 <= IDE_DSTB; |
CRC_ENB <= IDE_DSTB1 & ~IDE_DSTB; // trigger 1 clock after its deb |
end |
|
always @(posedge CLK4)begin |
////DelayHSTB <= HSTROBE; |
//HDMARDY <= ~STOP & (PA_HvSpace | (HDMARDY & (~PA_AlmostFull | ~XiRdy1))); //if we are almost full and enabled |
|
if (DMA_ARM == 1'b0) begin |
// ============================================================ |
UDI_ARM <= 1'b0; |
UHO_ARM <= 1'b0; |
STOP <= 1'b1; // always STOP |
HDMARDY <= 1'b0; // Host always not ready |
iWait <= 1'b0; // assume no wait |
HSTROBE <= 1'b1; // HSTrobe Control by us |
// =================== |
ND_ARM <= 1'b0; |
ND_Rd <= 1'b0; // no reading |
ND_Wr <= 1'b0; // stop anything |
ILatch <= 1'b0; |
// =================== |
iDK <= 1'b0; |
iDMA_OE <= 1'b0; // no OE |
iD_245_In <= 1'b0; // disable 245 driver direction control |
CRC_ARM <= 1'b0; // clear the CRC machine |
CRC_MUX <= 1'b0; // not selecting the CRC to output |
// CRC_ENB <= 1'b0; // do not enable the CRC |
// =============== RAM block control signal |
RegEA <= 1'b0; |
IncAddrA <= 1'b0; |
EnbA <= 1'b0; // enable and the control signal |
WrA <= 1'b0; |
iCount <= 5'b0000; |
HWOE <= 1'b0; |
PipeEmpty <= 1'b1; // pipeline is empty for reset |
iSTATE <= iIdle1; // keep the first state machine |
// ================== |
end else begin |
// ========================================================= |
if (UHO_ARM == 1'b1) begin |
if (SiRdy2 == 1'b1) begin |
iWait <= 1'b1; // need to wait |
iCount <= 5'd00; |
end else begin |
iCount <= iCount + 1; |
if (iCount[4] == 1'b1) begin |
iWait <= 1'b0; // clear the wait 16 clocks after SiRdy2 goes low |
end |
end |
end //UHO_ARM |
//============================================================ |
case (iSTATE) |
iIdle1: begin |
// ============================================================ |
UDI_ARM <= 1'b0; // Device In mode not ARM |
STOP <= 1'b1; // always STOP |
HDMARDY <= 1'b0; // always not ready |
// ============================================================ |
UHO_ARM <= 1'b0; // Host Out mode not ARM |
HSTROBE <= 1'b1; // HSTrobe Control by us |
// ============================================================ |
ND_ARM <= 1'b0; // Normal DMA not ARM |
ND_Rd <= 1'b0; // no reading |
ND_Wr <= 1'b0; // stop anything |
ILatch <= 1'b0; |
// =================== |
iDK <= 1'b0; |
iDMA_OE <= 1'b0; // no OE |
iD_245_In <= 1'b0; // disable control of 245 driver direction |
CRC_ARM <= 1'b0; // clear the CRC machine |
CRC_MUX <= 1'b0; // not selecting the CRC to output |
// =============== |
RegEA <= 1'b0; |
IncAddrA <= 1'b0; |
EnbA <= 1'b0; // enable and the control signal |
WrA <= 1'b0; |
iCount <= 5'b0000; |
// =============== |
iSTATE <= iIdle2; // next looping state |
end |
//// ============================================= |
iIdle2: begin |
iCount <= 5'd00; // set counter as 00 in this state |
if (iDQ == 1'b1) begin |
if (UDMAC == 1'b1) begin //- Ultra DMA mode |
if (PS2WrIDE == 1'b1) begin |
if (Proceed == 1'b1) begin // try to proceed to output data |
iSTATE <= Uho_0; // UW1: Write Data from PS2 to IDE |
end |
end else begin |
if (PA_HvSpace == 1'b1) begin |
iSTATE <= Udi1; // Read data from drive if we have space |
end |
end // PS2WrIDE |
end else begin //- normal mode |
if (PS2WrIDE == 1'b1) begin |
if (Proceed == 1'b1) begin // if one block of data is valid |
iSTATE <= ND_2; |
end |
end else begin |
if (PA_HvSpace == 1'b1) begin |
iSTATE <= ND_2; // if there is space |
end |
end //- PS2WrIDE |
end //-UDMA |
end else begin |
iSTATE <= iIdle2; // loop here until iDQ = 1; |
end // iDQ |
end |
////// ================================================= |
//-=== Multiword |
//== mode 0 = 480nS cycle = 72 state = ND_3..ND36 = 36/36 |
//== mode 1 = 150nS cycle = 22 state = 01,02,03,04,18,19,20,21,22,23,24 = 12/10 |
//== mode 2 = 120nS cycle = 18 state = 01,02,03,04,05, 20,21,22,23 = 10/8 |
//// ===== |
ND_2: begin |
iSTATE <= ND_3; // always |
iDK <= iDQ; // directly map the request |
ND_ARM <= 1'b1; // enter the normal DMA mode |
iD_245_In <= ~PS2WrIDE; // turn 245 inwards if |
end |
//// ====== |
ND_3: begin |
iDK <= iDQ; // directly map the request |
if (NBrkOut == 1'b0) begin // if not breaking out |
EnbA <= PS2WrIDE; // enable the RAM if writing |
iSTATE <= ND_4; // goto next state if iDQ is not zero and we are within A Block |
end else begin |
iD_245_In <= 1'b0; // breaking out, always turn the buffer outwards |
ND_ARM <= 1'b0; // no more arming of the signal |
iSTATE <= iIdle1; // exit to check again |
end |
end |
//// ===== |
ND_4: begin |
iSTATE <= ND_5; |
EnbA <= 1'b0; // already enabled, now turn off to conserve power |
RegEA <= PS2WrIDE; // enable the registers if RAM access |
end |
//// ===== |
ND_5: begin |
iSTATE <= ND_6; // goto next state ND_6 state |
RegEA <= 1'b0; // latch gated, turn off now |
iCount <= 5'd00; // reset the counter |
iDMA_OE <= PS2WrIDE; // if write to drive, we will drive the data bus |
end |
//// ===== |
ND_6: begin |
iSTATE <= ND_7; // goto next state ND_6 state |
ND_Rd <= ~PS2WrIDE; // if read from drive then strobe external signal |
ND_Wr <= PS2WrIDE; // if write to drive then strobe external signal |
end |
//// =============== determine cycle length ===================== |
ND_7: begin |
iCount <= iCount + 1; //count less 5 for processing |
if (((iCount == 5'd05) && (MDMA[2] == 1'b1)) || // strobe width is 10 clks |
((iCount == 5'd07) && (MDMA[1] == 1'b1)) || // strobe width is 12 clks |
(iCount == 5'd31) ) begin // strobe width is 36 clks |
iSTATE <= ND_8; // set end Phase |
end |
end |
//// =============== |
ND_8: begin |
ILatch <= ~PS2WrIDE; // if read from drive then enable input latch |
iSTATE <= ND_9; // proceed if I/O ready |
end |
ND_9: begin |
// if (SiRdy2 == 1'b1) begin |
iSTATE <= ND_A; // proceed if I/O ready |
// end |
end |
//// =============== |
ND_A: begin |
WrA <= ~PS2WrIDE; // if mode is read from drive then we pulse RAM |
EnbA <= ~PS2WrIDE; // if mode is read from drive then we pulse RAM |
iCount <= 5'd00; // reset counter |
iSTATE <= ND_B; |
end |
ND_B: begin |
WrA <= 1'b0; // always disable internal RAM Block write pulse |
EnbA <= 1'b0; // always disable the RAM Block control signal |
ND_Rd <= 1'b0; // always turn off external strobe |
ND_Wr <= 1'b0; // always turn off external strobes now |
ILatch <= 1'b0; // switch off data latch |
IncAddrA <= 1'b1; // inc internal RAM Block address to next location |
iSTATE <= ND_C; |
end |
//// ====================== end Phase |
ND_C: begin |
iDMA_OE <= 1'b0; // turn off the internal busdrivers |
IncAddrA <= 1'b0; // turn off RAM Block address |
HWOE <= A0; // select the next output data |
iCount <= iCount + 1; //count less 5 for processing |
if (((iCount == 5'd03) && (MDMA[2] == 1'b1)) || // recharge is 8 clks |
((iCount == 5'd05) && (MDMA[1] == 1'b1)) || // recharge is 10 clks |
(iCount == 5'd31) ) begin // recharge is 36 clks |
iSTATE <= ND_3; // loop again |
end |
end |
////-============================================================ |
//- Ultra DMA Drive In mode - we read from drive and write to FIFO |
////-============================================================ |
Udi1: begin // Udi1 state |
UDI_ARM <= 1'b1; // now the DMA_machine is UDI controlled |
iDK <= 1'b0; // no DMA first |
iDMA_OE <= 1'b0; // ensure we are not driving the FPGA output |
STOP <= 1'b1; // set to stop first |
HDMARDY <= 1'b0; // set to not ready first |
if (Phase3 == 1'b1) begin |
iSTATE <= Udi2; |
end |
end |
Udi2: begin // Udi2 state -- at least one clock |
if (iDQ == 1'b1) begin |
if ((Phase3 == 1'b1) && (SiRdy2 == 1'b1)) begin // wait until the drive drives high the IORDY signal |
iSTATE <= Udi3; |
end |
end else begin |
iSTATE <= iIdle1; // exit to idle if iDQ suddenly gone |
end |
end |
Udi3: begin // Udi3 state -- at least one clock |
iDK <= 1'b1; // we issue DMA ready for iDQ |
iD_245_In <= 1'b1; // turn the driver inwards |
CRC_ARM <= 1'b1; // start the CRC machine |
if (Phase3 == 1'b1) begin |
iSTATE <= Udi10; |
end |
end |
//// ================== |
//HDMARDY <= ~STOP & (PA_HvSpace | (HDMARDY & ~(PA_AlmostFull & XiRdy1))); //if we are almost full and enabled |
|
Udi10: begin |
IncAddrA <= 1'b0; // always clear the increment address pulse |
if (XiRdy1 == 1'b1) begin // delay 2 and 3 |
EnbA <= 1'b1; |
WrA <= 1'b1; |
// CRC_ENB <= 1'b1; // calculate the CRC |
iSTATE <= Udi11; |
end else begin |
if (iDQ == 1'b1) begin // if iDQ still valid |
HDMARDY <= ~PA_AlmostFull; //20100623 still have space |
STOP <= 1'b0; // 20100623 not stopping |
iSTATE <= Udi10; // loop here |
end else begin |
HDMARDY <= 1'b0; //20100623 |
STOP <= 1'b1; //20100623 |
iSTATE <= Udix1; // no more iDQ then exit |
end |
end |
end |
Udi11: begin |
iSTATE <= Udi10; // loop back for fast processing |
EnbA <= 1'b0; // no more RAM enable |
WrA <= 1'b0; // no more Wr enable |
// CRC_ENB <= 1'b0; // no more CRC |
IncAddrA <= 1'b1; // just increment the address |
end |
//// ========================= exit routine ==================== |
Udix1: begin |
if ((Phase3 == 1'b1) && (SiRdy2 == 1'b1)) begin // wait until the drive drives high the IORDY signal |
iSTATE <= Udix2; |
end |
end |
Udix2: begin |
CRC_MUX <= 1'b1; //20100622 add one clock earlier to turn the CRC_MUX to data bus |
iD_245_In <= 1'b0; //20100622 add one clock earlier to turn the 245 outwarts |
if (Phase3 == 1'b1) begin |
iSTATE <= Udix3; // wait at least one clock |
end |
end |
Udix3: begin |
iDMA_OE <= 1'b1; // 20100622 add one clock earlier drive high the OE to output the CRC address |
if (Phase3 == 1'b1) begin |
iSTATE <= Udix4; // wait at least two clock |
end |
end |
Udix4: begin |
if (Phase3 == 1'b1) begin |
iSTATE <= Udix5; // wait at least two clock |
end |
end |
Udix5: begin |
iDK <= 1'b0; // stop the iDK |
if (Phase3 == 1'b1) begin |
iSTATE <= Udix6; // wait at least two clock |
end |
end |
Udix6: begin |
if (Phase3 == 1'b1) begin |
iSTATE <= iIdle1; // wait at least two clock |
end |
end |
////-====================================================== |
//- Ultra DMA Host Out mode - we read from DMA RAM and write to drive |
//- only here we detemine the cycle time |
//- UDMA(2) = 60nS cycle time = 8 clock |
//- UDMA(1) = 80nS (81.6) = 12 clock |
//- UDMA(0) = 120nS cycle time = 16 clock |
////-====================================================== |
Uho_0: begin // UW1 state |
UHO_ARM <= 1'b1; |
iDK <= 1'b1; // enable the iDKs |
STOP <= 1'b1; // STOP the system first |
HSTROBE <= 1'b1; // STROBE is high |
EnbA <= PipeEmpty; // enable the RAM if the pipeline is empty |
iSTATE <= Uho_1; // UW2 state |
end |
//// ======= entry from temporary stop with refill data ================= |
Uho_1: begin // UW2 state |
iDK <= 1'b1; // DMA ready |
EnbA <= 1'b0; // already enable the RAM, turn it off |
RegEA <= PipeEmpty; // enable register if the pipeline is empty |
iD_245_In <= 1'b0; // turn the driver outwards, data is now put to bus |
iSTATE <= Uho_2; // UW3 state |
end |
//// ======= |
Uho_2: begin |
RegEA <= 1'b0; // register already enabled |
HWOE <= ~PipeEmpty ^ A0; // if empty uses A0; if not empty uses ~A0 |
iSTATE <= Uho_3; // UW4 state |
end |
//// ======== |
Uho_3: begin // UW4 state |
STOP <= 1'b0; // remove the STOP signal |
if ((SiRdy2 == 1'b0) && (Phase3 == 1'b1)) begin |
iSTATE <= Uho_4; // wait till ready |
iDMA_OE <= 1'b1; // drive the OE data |
end |
end |
//// ======== wait 2 clocks ; restart from old break |
Uho_4: begin |
if ((SiRdy2 == 1'b0) && (Phase3 == 1'b1)) begin |
IncAddrA <= PipeEmpty; //Increment the address if the pipe is empty |
iSTATE <= Uho_5; //wait 1 clock |
end |
end |
//// ==== already have valid data in the bus |
Uho_5: begin |
IncAddrA <= 1'b0; // no more increment the address |
if ((SiRdy2 == 1'b0) && (Phase3 == 1'b1)) begin |
EnbA <= 1'b1; // after increment address, enable the RAM |
iSTATE <= Uho_6; |
end |
end |
/// === one clock +ve data advance offset data bus |
Uho_6: begin |
iSTATE <= Uho_7; // jump into the main loop |
EnbA <= 1'b0; // disable the RAM |
iWait <= 1'b0; // no need to wait here |
HSTROBE <= 1'b0; // first strobe edge is low |
CRC_ARM <= 1'b1; // enable the CRC machine |
end |
//// ====== host output loop is here ================== |
Uho_7: begin |
/// data bus and associate control signal |
ILatch <= 1'b1; // house keeping enable data bus ilatch for CRC calculation |
/// determine buffer content, check if more data to send |
if (PA_Empty == 1'b1) begin |
iSTATE <= Uho_F; // last data on bus and no more data, normal exit now |
end else begin |
RegEA <= UDMA[2]; // enable the register now if UDMA-mode 2 |
iSTATE <= Uho_8; // more data to send, keep looping |
end |
end |
//// |
Uho_8: begin |
/// data bus control signal |
RegEA <= UDMA[1]; // enable the register now if UDMA-mode 1 / disable if mode 2 |
ILatch <= 1'b0; // stop the input data latch and pass data to CRC engine |
HWOE <= (UDMA[2] == 1'b1) ? A0 : HWOE; |
/////////// |
if (UDMA[2] == 1'b1) begin |
IncAddrA <= 1'b1; // increase the address |
iSTATE <= Uho_D; // 4 clocks 7,8,D,E |
end else begin |
iSTATE <= Uho_9; |
end |
end |
/////// ================================== |
Uho_9: begin |
/// data bus control signal |
RegEA <= 1'b0; // disable the register access always |
HWOE <= (UDMA[1] == 1'b1) ? A0 : HWOE; |
///////// |
if (UDMA[1] == 1'b1) begin |
iSTATE <= Uho_C; // 6 clocks 7,8,9,C,D,E |
end else begin |
iSTATE <= Uho_A; |
end |
end |
////// =================================== |
Uho_A: begin |
RegEA <= UDMA[0]; // enable the register now if UDMA-mode 0 / disable otherwise |
iSTATE <= Uho_B; // 8 cycles 7,8,9,A,B,C,D,E |
end |
///// middle point of the strobe //////====================== |
Uho_B: begin |
/// data bus control signal |
RegEA <= 1'b0; // disable the register access always |
HWOE <= (UDMA[0] == 1'b1) ? A0 : HWOE; |
iSTATE <= Uho_C; |
end |
Uho_C: begin |
iSTATE <= Uho_D; |
IncAddrA <= 1'b1; // increase the address for one clock |
end |
Uho_D: begin |
iSTATE <= Uho_E; |
IncAddrA <= 1'b0; // no more increment the address |
EnbA <= 1'b1; // after increment address, enable the RAM |
end |
Uho_E: begin |
EnbA <= 1'b0; // disable the RAM |
if (iDQ == 1'b0) begin // check iDQ |
iSTATE <= Uhx_0; // lost iDQ abnormal exit |
end else begin |
if (iWait == 1'b0) begin |
// CRC_ENB <= 1'b1; // data stobed, so can calculate CRC |
HSTROBE <= ~HSTROBE; // toggle the strobe and keep |
iSTATE <= Uho_7; // loop back for another data |
end else begin |
iSTATE <= Uho_E; // loop here until no more wait |
end |
end |
end |
//// =========================== end of host output loop ========= |
/// === all host data out now, determine exit or re-run refill ===================== |
Uho_F: begin |
PipeEmpty <= 1'b1; // pipe is empty |
ILatch <= 1'b0; // stop the input data latch and pass data to CRC engine |
if (Phase3 == 1'b1) begin |
iSTATE <= Uho_G; // exit now |
end |
end |
Uho_G: begin |
STOP <= 1'b1; // drive high the stop signal |
if (Phase3 == 1'b1) begin |
if ((SiRdy2 == 1'b1) && (iDQ == 1'b0)) begin // wait here until ready and DMA request is gone |
iSTATE <= Uhx_3; // wait at least two clock |
end else begin |
if (PA_OD_Rdy == 1'b1) begin // or wait until there is one block of data to transfer out |
EnbA <= PipeEmpty; // enable the RAM if the pipeline is empty (always 1'b1) |
iSTATE <= Uho_1; // jump back into the main loop if there is data |
end |
end |
end |
end |
//// ==== lost of iDQ, data still in RAM BLOCK Register exit ============ |
Uhx_0: begin |
PipeEmpty <= 1'b0; // clear flag as the UHO machine has unread content |
if (Phase3 == 1'b1) begin |
iSTATE <= Uhx_1; |
end |
end |
Uhx_1: begin |
if (Phase3 == 1'b1) begin |
iSTATE <= Uhx_2; // wait at least two clock |
end |
end |
Uhx_2: begin |
STOP <= 1'b1; // drive high the stop signal |
if ((Phase3 == 1'b1) && (SiRdy2 == 1'b1) && (iDQ == 1'b0)) begin // wait here until ready and DMA request is gone |
iSTATE <= Uhx_3; // wait at least two clock |
end |
end |
Uhx_3: begin |
HSTROBE <= 1'b1; // must set high the HSTROBE signal now |
CRC_MUX <= 1'b1; // turn the CRC_MUX to data bus |
if (Phase3 == 1'b1) begin |
iSTATE <= Uhx_4; // wait at least two clock |
end |
end |
Uhx_4: begin |
if (Phase3 == 1'b1) begin // wait here until ready is gone |
iSTATE <= Uhx_5; // wait at least two clock |
end |
end |
Uhx_5: begin |
iDK <= 1'b0; // stop the iDK |
if (Phase3 == 1'b1) begin |
iSTATE <= Uhx_6; // wait at least two clock |
end |
end |
Uhx_6: begin |
if (Phase3 == 1'b1) begin |
iSTATE <= iIdle1; // wait at least two clock |
end |
end |
//// ======================== end of UHO loop ================= |
default: begin |
iSTATE <= iIdle1; // jump to idle for rouge states |
end |
endcase |
end // DMA_ARM |
end // clock edges |
|
endmodule |
/cxd9731/PS2_DMA.v
0,0 → 1,292
`timescale 1ns / 1ps |
////////////////////////////////////////////////////////////////////////////////// |
// Company: |
// Engineer: |
// |
// Create Date: 10:31:00 12/08/2008 |
// Design Name: |
// Module Name: PS2_DMA - Behavioral |
// Project Name: |
// Target Devices: |
// Tool versions: |
// Description: |
// |
// Dependencies: |
// |
// Revision: |
// Revision 0.01 - File Created |
// Additional Comments: |
// |
////////////////////////////////////////////////////////////////////////////////// |
|
module PS2_DMA ( |
// PS2_DMA_STATE : out std_logic_vector(15 downto 0); |
input CLK4, // 146.6MHz clock input |
input Phase3, // the phases |
////// external pin interface |
output reg cDQ, // DMA request output |
input cDK, // DMA acknowledge input |
input cRd, // read pulse |
input DWrite, // write and counter pulse |
////// controlling signal |
input DMA_ARM , // signal from ctrllr to inits DMA |
input PS2WrIDE , // level indicating that PS2 is DMA writing IDE bus |
//// PS2 DMA connecting to RAM interface |
input PB_OD_Rdy , // set high if at least 512 bytes in buffer (only check high order bits) |
input PB_HvSpace , // set high if there is at least 512 bytes empty space in buffer (only check high order bits) |
input WithinBBlock , // high if (AddrB(6) | AddrB(5)) = 1 |
input BBurstEnd , // high if AddrB = xxxx11111 = 1F |
//// |
output reg IncAddrB , |
output RegEB , // pipeline register enable |
output reg EnbB , |
output reg WrB |
); |
|
reg DTook; |
reg DWrote; |
|
// reworking the state machines at 100807 |
|
parameter PIdle = 5'b00000; |
/// read phases |
parameter PR20 = 5'b00100; |
parameter PR21 = 5'b00101; |
parameter PR22 = 5'b00110; |
parameter PR23 = 5'b00111; |
parameter PR32 = 5'b01000; |
parameter PR37 = 5'b01001; |
parameter PR38 = 5'b01010; |
parameter PR38A = 5'b01011; |
parameter PR38B = 5'b01100; |
/// write phases |
parameter PW01A = 5'b10001; |
parameter PW01B = 5'b10010; |
parameter PW01C = 5'b10011; |
parameter PW01D = 5'b10100; |
parameter PW32 = 5'b10101; |
parameter PW35 = 5'b10110; |
parameter PW36 = 5'b10111; |
parameter PW37 = 5'b11000; |
parameter PW38A = 5'b11001; |
parameter PW38B = 5'b11010; |
parameter PW38C = 5'b11011; |
parameter PW38D = 5'b11100; |
parameter PW40 = 5'b11101; |
|
reg [4:0] PSST; |
reg OPOvrRide; |
|
////- ============== test stubs |
//PS2_DMA_STATE (15 downto 6) <= "0000000000"; |
//PS2_DMA_STATE ( 5 downto 0) <= STATE(5 downto 0); |
//TYPE GBState_type IS (A, B, C, D); |
//SIGNAL GBState : GBState_Type; |
|
//////////// ================== END OF TEST STUBBS ======================= |
|
assign RegEB = Phase3 & ( cRd | OPOvrRide ); |
|
//// =================== |
|
always @(posedge CLK4) begin |
if (DMA_ARM == 1'b0) begin |
cDQ <= 1'b0; // always no request |
DTook <= 1'b0; |
DWrote <= 1'b0; |
IncAddrB <= 1'b0; |
OPOvrRide <= 1'b0; |
EnbB <= 1'b0; |
WrB <= 1'b0; |
PSST <= PIdle; |
end else begin |
////===== State machine default state ====== |
case (PSST) |
PIdle: begin |
if (PS2WrIDE == 1'b0) begin // if reading from disk |
cDQ <= 1'b0; // always 0 if we don't have enough data |
if ((PB_OD_Rdy == 1'b1) && (Phase3 == 1'b1)) begin // if there is data in the buffer |
PSST <= PR38; // go to PR38 |
end |
end else begin |
cDQ <= PB_HvSpace; // high if we have space |
if ((cDK == 1'b1) && (Phase3 == 1'b1)) begin |
PSST <= PW40; // PSST <= PW40A; |
end |
end |
end |
//////- ======== PS2 reading DMA states //////////////////////- |
PR38: begin |
cDQ <= 1'b0; // data not ready |
DTook <= 1'b1; // increment address for the every burst |
if (Phase3 == 1'b1) begin |
PSST <= PR38A; // clock the state machine into correct phase |
end |
end |
//////- ======================================================== |
PR38A: begin |
EnbB <= DTook; // be generous, 4 cycle enable for RAM data |
if (Phase3 == 1'b1) begin |
PSST <= PR38B; // one dummy state |
end |
end |
//////- ======== PR2 state, latch the data and wait for ACK going high |
PR38B: begin |
EnbB <= 1'b0; // no more force read enable for RAM |
OPOvrRide <= 1'b1; // always output the data |
cDQ <= 1'b1; // can request transfer now |
if ((Phase3 == 1'b1) && (cDK == 1'b1)) begin |
PSST <= PR20; // acknowledge so proceed |
DTook <= cRd; // check if first data taken |
end |
end |
//// ======= PS2 Reading the DMA RAM // loop here =========================== |
PR20: begin |
OPOvrRide <= 1'b0; // no need to force output data now |
IncAddrB <= DTook; // data taken, rush data to output |
if ((DTook == 1'b1) && (BBurstEnd == 1'b1)) begin // if currently pointing to last address and data taken |
PSST <= PR32; // address will be inc past, so just goto last stage, output registers are all set already |
end else begin |
PSST <= PR21; // continue |
end |
end |
PR21: begin |
IncAddrB <= 1'b0; // no more address increment |
EnbB <= DTook; // if data taken then update the Enb pulse correct phase enable pulse |
PSST <= PR22; |
end |
PR22: begin |
EnbB <= 1'b0; // RAM enable turn off after this cycle |
cDQ <= cDQ & ~DTook; // keep request until first data taken cDQ will fall at end of Phase 2 |
PSST <= PR23; |
end |
PR23: begin |
DTook <= cRd; // if read is asserted at phase 3, data was took |
if (cDK == 1'b1) begin |
PSST <= PR20; |
end else begin |
PSST <= PR37; // cDK gone unexpectedly |
end |
end |
// if (DTaken == 1'b0) begin |
// PSST <= PR01A; // data not taken, keep looping |
// end else begin |
// IncAddrB <= 1'b1; // data taken, new address |
// if (BBurstEnd == 1'b1) begin // if currently pointing to last address and data taken |
// PSST <= PR32; // go to last state, register must have been set |
// end else begin |
// PSST <= PR01A; // loop back |
// end |
// end |
////- ======== PR32 state // last clock, cleaning the pipeline |
PR32: begin // outputing the last data |
IncAddrB <= 1'b0; // no more address increment |
if (cDK == 1'b1) begin |
PSST <= PR32; |
end else begin |
PSST <= PR37; // idle end |
end |
end |
////- ======================= End of DMA loops ========================== |
PR37: begin |
if (WithinBBlock == 1'b1) begin |
if (Phase3 == 1'b1) begin |
PSST <= PR38; // loop back and do again |
end else begin |
PSST <= PR37; |
end |
end else begin |
PSST <= PIdle; // block transferred go back to idle state |
end |
end |
//////================== End of DMA Read loop =========================== |
//////======== PS2 writing DMA RAM, PW40A ===================== |
PW40: begin |
if ((Phase3 == 1'b1) && (cDK == 1'b1)) begin |
PSST <= PW01A; // clock the state machine into correct phase |
end |
end |
////////- =========== PW01A ==================================== |
PW01A: begin |
IncAddrB <= 1'b0; // no more increment address |
PSST <= PW01B; |
end |
PW01B: begin |
DWrote <= DWrite; // a cleaner condition for testing |
PSST <= PW01C; |
end |
PW01C: begin |
EnbB <= DWrote; // enable write the RAM in the end of phase 3 |
WrB <= DWrote; // will write the RAM in phase 3 |
PSST <= PW01D; |
end |
PW01D: begin |
EnbB <= 1'b0; // always turn off the RAM to conserve power |
WrB <= 1'b0; |
IncAddrB <= DWrote; // need to increment address if we have wrote anything last cycle |
if (DWrote == 1'b1) begin // if last time we have written |
if (BBurstEnd == 1'b1) begin // if address before increment is last for this burst |
PSST <= PW32; // then we exit the loop for a while |
end else begin |
PSST <= PW01A; // else loop back |
end |
end else begin |
PSST <= PW01A; // last time we have not written anything; loop again |
end |
end |
////- ======== PW32 state, wait for 8 cycles and raise the CDREQ |
PW32: begin |
IncAddrB <= 1'b0; // clear the increment address |
if (cDK == 1'b1) begin |
PSST <= PW32; // loop back and wait until no more cDK |
end else begin |
PSST <= PW35; |
end |
end |
//// ======== finish burst writing and cDK deassert, now check status of buffer |
PW35: begin |
if (Phase3 == 1'b1) begin |
PSST <= PW36; |
end |
end |
PW36: begin |
if (WithinBBlock == 1'b1) begin |
if (Phase3 == 1'b1) begin |
PSST <= PW37; // skip and continue looping to write sector data |
end else begin |
PSST <= PW36; // loop here waiting |
end |
end else begin |
PSST <= PIdle; //- lead out to Idle state |
end |
end |
//// ============================================================ |
PW37: begin |
if (Phase3 == 1'b1) begin |
PSST <= PW38A; |
end |
end |
//// ================================================================= |
PW38A: begin |
PSST <= PW38B; |
end |
PW38B: begin |
PSST <= PW38C; |
end |
PW38C: begin |
cDQ <= 1'b1; // Raise the LREQ again at the falling edge of CLK |
PSST <= PW38D; |
end |
PW38D: begin |
PSST <= PW40; // loop again |
end |
////================== End of DMA Write loop =========================== |
default: begin |
PSST <= PIdle; |
end |
endcase |
end // rising_edge(CLK4) |
end |
|
endmodule |
|
/cxd9731/README.pdf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
cxd9731/README.pdf
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: cxd9731/Reg38.v
===================================================================
--- cxd9731/Reg38.v (nonexistent)
+++ cxd9731/Reg38.v (revision 5)
@@ -0,0 +1,118 @@
+`timescale 1ns / 1ps
+//////////////////////////////////////////////////////////////////////////////////
+// Company:
+// Engineer:
+//
+// Create Date: 12:24:03 11/08/2008
+// Design Name:
+// Module Name: Reg38 - Behavioral
+// Project Name:
+// Target Devices:
+// Tool versions:
+// Description:
+//
+// Dependencies:
+//
+// Revision:
+// Revision 0.01 - File Created
+// Additional Comments:
+//
+//////////////////////////////////////////////////////////////////////////////////
+
+//// Uncomment the following library declaration if instantiating
+//// any Xilinx primitives in this code.
+//library UNISIM;
+//use UNISIM.VComponents.all;
+////- Reg0038 has the following bits being mapped
+//// bcIRQ cDQ cDK iIRQ iDQ ibDK Mo86 Mo87
+//// 1 0 0 0 0 1 0060 ---- // bus idle
+//// 1 0 0 0 1 0 0020 ---- // IDE side doing transaction buffer not full
+//// 1 0 0 0 1 0 ---- 0020 // IDE side doing transaction buffer not full
+//// 1 1 0 0 1 0 ---- 00A0 // IDE side doing transaction and buffer full
+//// 1 1 0 0 1 1 ---- 0050 // just start DMA and drive not responding
+//// 1 1 0 0 1 0 0021,23,24 // buffer size
+//// 1 1 0 1 0 1 0021,22 // fixed ???
+////==================================================
+//// Design base on above measurements : note the {} value is iDK = NOT(ibDK)
+//// cDQ cDK iIRQ iDQ ibDK Mo86 Mo87
+//// x x 1 x x 21 for NOT(UDMA) 22 for UDMA
+//// 1 0 0 x 0{1} buffer size (21,23,24,...27)
+//// 1 0 0 1 1{0} - 50
+//// 0 x 0 0 x 60 bus idle
+//// 0 x 0 1 x 20 if buffer not full
+//// 0 x 0 1 x A0 if buffer full
+
+module Reg38(
+ input UDMAC ,
+ input PS2WrIDE ,
+ input iIRQ ,
+ input cDQ ,
+ input iDQ ,
+ input iDK ,
+ input BufEmpty ,
+ input PB_HvSpace , // Port A have space
+ input [3:0] BufSize ,
+ output [7:0] DOut
+);
+
+/// Start of Register 38
+
+wire [7:0] R381;
+wire [7:0] W381;
+wire WCond1;
+wire WCond2,WCond2A,WCond2B1,WCond2B2;
+wire WCond3;
+//wire WCond3A,WCond3B;
+//wire RCond1,RCond2;
+wire Activity;
+
+assign Activity = cDQ | iIRQ | iDQ | iDK | BufSize[3] | BufSize[2] | BufSize[1] | BufSize[0]; // if there is no DMA activity
+//assign R381[7:2] = 6'b00_1000; // fix as 2x
+//assign R381[1] = BufSize[2] | BufSize[1];
+//assign R381[0] = BufSize[2] | BufSize[0];
+assign R381[7] = 1'b0; // always zero
+assign R381[6] = ~Activity; // no activity will be high
+assign R381[5:4] = 2'b10; // set as 2
+assign R381[3:0] = BufSize[3:0];
+
+assign W381[7:0] =
+ (BufSize[3:0] == 4'b1000) ? 8'h20 : // no space left, the buffer is full
+ (BufSize[3:0] == 4'b0111) ? 8'h21 : // one page has been taken, so one space left
+ (BufSize[3:0] == 4'b0110) ? 8'h22 : // two page taken
+ (BufSize[3:0] == 4'b0000) ? 8'h24 : // buffer empty
+ 8'h23; // otherwise
+//assign W381[1] = ~(BufSize[2] & BufSize[1]);
+//assign W381[0] = ~(BufSize[2] & BufSize[1] & BufSize[0]);
+//assign W381[1] = BufSize[2]; // take 0304 it representing very little space
+//assign W381[0] = PB_HvSpace;
+//assign RCond1 = ~(PS2WrIDE) & ~(Activity); // DMA reading and bus not active
+//assign RCond2 = ~(PS2WrIDE) & Activity; // DMA reading and bus active
+assign WCond1 = PS2WrIDE & ~(PB_HvSpace); // if there is no space in buffer
+assign WCond2 = PS2WrIDE & ~(iDK); // bus active but drive side no transfer request
+assign WCond2A = WCond2 & BufEmpty; // we don't have data in output register
+assign WCond2B1 = WCond2 & ~(BufEmpty) & UDMAC; // if there is data and we are UDMA mode, report as "22"
+assign WCond2B2 = WCond2 & ~(BufEmpty) & ~(UDMAC); // if there is data and we are MDMA mode, report as "21"
+assign WCond3 = PS2WrIDE & iDK; // if there is drive side transfer, PS2 writing data to drive
+//assign WCond3A = WCond3 & BufEmpty;
+//assign WCond3B = WCond3 & ~(BufEmpty); // if something in buffer
+
+
+assign DOut =
+//// 86 mode, PortA input, Port B output data //
+// (RCond1 == 1'b1) ? 8'h60 :
+// (RCond2 == 1'b1) ? R381 :
+ (PS2WrIDE == 1'b0) ? R381 : // PS2WrIDE = 0, reading from drive
+//// 87 mode, PortB input, Port A output data //
+ (WCond1 == 1'b1) ? 8'hA0 : // if no space in buffer B, then buffer is full
+//// if PortA have no transaction, iDK = 0 then
+ (WCond2A == 1'b1) ? 8'h50 : // if bufferA is absolutely empty
+ (WCond2B1 == 1'b1) ? 8'h22 : // if bufferA is not empty
+ (WCond2B2 == 1'b1) ? 8'h21 :
+//// if PortA have transaction, iDK = 1
+ (WCond3 == 1'b1) ? W381 :
+// (WCond3A == 1'b1) ? 8'h24 : // plenty of buffer space
+// (WCond3B == 1'b1) ? W381 :
+ 8'hFF;
+///////// end of reg38 ////////////////////////////
+
+endmodule
Index: cxd9731/SCHEMATIC.pdf
===================================================================
--- cxd9731/SCHEMATIC.pdf (nonexistent)
+++ cxd9731/SCHEMATIC.pdf (revision 5)
@@ -0,0 +1,938 @@
+%PDF-1.5
+%âãÏÓ
+2 0 obj
+<<
+/Page 1
+/Type /Catalog
+/View [/Fit]
+/Pages 4 0 R
+/Metadata 5 0 R
+>>
+endobj
+5 0 obj
+<<
+/Type /Metadata
+/Length 3352
+/Subtype /XML
+>>
+stream
+
+
+
+
+ Bullzip PDF Printer / www.bullzip.com / Freeware Edition
+
+
+ 2017-08-11T06:29:30+08:00
+ 2017-08-11T05:27:23+08:00
+ UnknownApplication
+
+
+ uuid:329b0984-806e-11e7-0000-7ac6b7686424
+ uuid:329b0984-806e-11e7-0000-7ac6b7686424
+
+
+ application/pdf
+
+
+ nadp09_1
+
+
+
+
+ sf
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+endstream
+endobj
+7 0 obj
+<<
+/Filter [/FlateDecode]
+/Length 46009
+>>
+stream
+xœì½[9’&ÝRJIÈ”òR•¥)CRf—ÔE;ïäë‹ó²=ÌCiŸjw§1ÈH`jæï¯}ftw3žãáÒ©êêîR^tŒŸÓœf43^üŸÓ¥óþ™üéêñ?ýs¹øïÿßc—/sÎåâ=v§Éµè‡OS+åâŸÿÇ.¹t9µ×¦|éýÅÕcRº¬åÂO®^ñ¥™¥D§´|Ù¥øt)ÔvY#%„vËÑù<½¬“R½œÂÅŸËÈÓekÌÀI¯ªžÈ.3àÒ.ã]6°¨õ2ħv2Ñ-¡P.zw™Ú…wÓ„WQŽHeIx¢ÄË©¢”1¸Kf
+ KâwæxYÈé2{)$qÒ_äb“*=ᢔ*æK…nA¤±8¥!Å_:ðtå²4Q”ãW§Ô•Ë|“$ŽG¯ 1&RD$
+¢zš»lRˆüîÂ¥+j¨Â_ÿÕ»#=’2©1£VsH\AŽ¸s¬—•ÔCÐe¢7eªwÔ©#áB/Õ¡ó/¢WçT`bÞ965¢ÊHUà.ÉȈQºÔ:rxQ8 áÀr¢:‚r2,Ë¥RDá$Šgõ%”
+%TÊèݬÍÂÚLSàLTT²¨¯dŽëØ“bžØ
+`ÚK— 296Od ¢Dè!R†(OÀ].—̨¸KOUîÈÌš˜QM(Û]šTêéIEl—LÒ›ðOe§ª')+{q€)“"ª†dDI¡$Ô[@ŠcßÉeD¡ÉâIc‡t\Α|ç!Ö!°
+Ä•’-s¹”ýeåÒßä\ŸÅÖ+"‘‡%É@âBd(
+¥—&¼œÝ-V©KßUK)Èá³XŠ¹HµŠ®¥˜H‰$Llü°'"Ì`°Ñ?ÁlTêlâݦܤ~j„~!**ŸÕ#¡"ÅÀVç(&EˆJ®£qÝÿI/"¦Hó¨AG!(£ÊÁ8Åž"NYƒ8¬ FR')¹Â Ál$p<ì62±U„bIO ÃÄåbYyKê†D†¬ðââɘųÉá&ÊÈî#§d²÷c¢æ§Pàt0·œáήÀ®`MTóPGðÈA¼
+h¡P3eɯ*dw Þ¨ÒÜÒƒ³¸1U)ŠA€ë±cb
+ dÒK)¥$Ëôš Òür Ÿ„%2ÜH…‹0ÓÈ2“QÃß"ìL¢ KžéQk1ÈÛ¸f}ls ø0ïJù*i/P4 òHb“Qý]y¨øˆŠF.WƒØl Šö’b¸ãÆíñ ˆÝàÜÄäbã¦ÂºÀâ'Ï-³¦—T<ãК %rKÅ¢Rká*©TŽy®R©&Ð1´^©ixo%¿Çã…›ŽHƒ¿UÄï=M=òÝFõ”©0^ê€|—©åžX—
+M
+AqŽ¸ýr ‹ÜšDæL¾îa›&~{ñä—ǵ)ê“%Vx75Šä$y¸« 6•ÑžSÙ8MeNQBWo2Ù<|/$µ—µq¸qJ(5nUâSªÞOÎîÙІTn¬Ùân"ïÁ¤„Ò3SQ\€„~DýNhSéê¥~ +Ò§IC›2£d 2S¿Ágª@ªv~K¡ Í5H-&Ì¢f¤-¨ä¦(D!©9cmìäiZäÚ€I¸ó"ÞQ¨
+E·¦QëÁ3s;Ezh\3%3ä C¬)è” §Øí
+5pdwDgô]ˆö(2PÜE±Ð›@ç