2019-03-07 11:08:26 -06:00
|
|
|
// https://coredocs.s3.amazonaws.com/Libero/12_0_0/Tool/sf2_mlg.pdf
|
|
|
|
|
2021-04-09 08:44:08 -05:00
|
|
|
module AND2 (
|
2019-03-07 11:08:26 -06:00
|
|
|
input A, B,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A & B;
|
|
|
|
endmodule
|
|
|
|
|
2021-04-09 08:44:08 -05:00
|
|
|
module AND3 (
|
2019-03-07 11:08:26 -06:00
|
|
|
input A, B, C,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A & B & C;
|
|
|
|
endmodule
|
|
|
|
|
2021-04-09 08:44:08 -05:00
|
|
|
module AND4 (
|
2019-03-07 11:08:26 -06:00
|
|
|
input A, B, C, D,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A & B & C & D;
|
|
|
|
endmodule
|
|
|
|
|
2019-03-06 18:18:49 -06:00
|
|
|
module CFG1 (
|
|
|
|
output Y,
|
|
|
|
input A
|
|
|
|
);
|
|
|
|
parameter [1:0] INIT = 2'h0;
|
|
|
|
assign Y = INIT >> A;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module CFG2 (
|
|
|
|
output Y,
|
|
|
|
input A,
|
|
|
|
input B
|
|
|
|
);
|
|
|
|
parameter [3:0] INIT = 4'h0;
|
|
|
|
assign Y = INIT >> {B, A};
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module CFG3 (
|
|
|
|
output Y,
|
|
|
|
input A,
|
|
|
|
input B,
|
|
|
|
input C
|
|
|
|
);
|
|
|
|
parameter [7:0] INIT = 8'h0;
|
|
|
|
assign Y = INIT >> {C, B, A};
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module CFG4 (
|
|
|
|
output Y,
|
|
|
|
input A,
|
|
|
|
input B,
|
|
|
|
input C,
|
|
|
|
input D
|
|
|
|
);
|
|
|
|
parameter [15:0] INIT = 16'h0;
|
|
|
|
assign Y = INIT >> {D, C, B, A};
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module BUFF (
|
|
|
|
input A,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module BUFD (
|
|
|
|
input A,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module CLKINT (
|
|
|
|
input A,
|
2020-07-04 15:20:26 -05:00
|
|
|
(* clkbuf_driver *)
|
2019-03-06 18:18:49 -06:00
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module CLKINT_PRESERVE (
|
|
|
|
input A,
|
2020-07-04 15:20:26 -05:00
|
|
|
(* clkbuf_driver *)
|
2019-03-06 18:18:49 -06:00
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module GCLKINT (
|
|
|
|
input A, EN,
|
2020-07-04 15:20:26 -05:00
|
|
|
(* clkbuf_driver *)
|
2019-03-06 18:18:49 -06:00
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A & EN;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module RCLKINT (
|
|
|
|
input A,
|
2020-07-04 15:20:26 -05:00
|
|
|
(* clkbuf_driver *)
|
2019-03-06 18:18:49 -06:00
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module RGCLKINT (
|
|
|
|
input A, EN,
|
2020-07-04 15:20:26 -05:00
|
|
|
(* clkbuf_driver *)
|
2019-03-06 18:18:49 -06:00
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A & EN;
|
|
|
|
endmodule
|
|
|
|
|
2018-10-31 09:28:57 -05:00
|
|
|
module SLE (
|
|
|
|
output Q,
|
|
|
|
input ADn,
|
|
|
|
input ALn,
|
2020-07-04 15:20:26 -05:00
|
|
|
(* clkbuf_sink *)
|
2018-10-31 09:28:57 -05:00
|
|
|
input CLK,
|
|
|
|
input D,
|
|
|
|
input LAT,
|
|
|
|
input SD,
|
|
|
|
input EN,
|
|
|
|
input SLn
|
|
|
|
);
|
|
|
|
reg q_latch, q_ff;
|
|
|
|
|
|
|
|
always @(posedge CLK, negedge ALn) begin
|
|
|
|
if (!ALn) begin
|
|
|
|
q_ff <= !ADn;
|
|
|
|
end else if (EN) begin
|
|
|
|
if (!SLn)
|
|
|
|
q_ff <= SD;
|
|
|
|
else
|
|
|
|
q_ff <= D;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
always @* begin
|
|
|
|
if (!ALn) begin
|
|
|
|
q_latch <= !ADn;
|
|
|
|
end else if (CLK && EN) begin
|
|
|
|
if (!SLn)
|
|
|
|
q_ff <= SD;
|
|
|
|
else
|
|
|
|
q_ff <= D;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
assign Q = LAT ? q_latch : q_ff;
|
|
|
|
endmodule
|
|
|
|
|
2019-03-06 18:18:49 -06:00
|
|
|
// module AR1
|
|
|
|
// module FCEND_BUFF
|
|
|
|
// module FCINIT_BUFF
|
|
|
|
// module FLASH_FREEZE
|
|
|
|
// module OSCILLATOR
|
|
|
|
// module SYSRESET
|
|
|
|
// module SYSCTRL_RESET_STATUS
|
|
|
|
// module LIVE_PROBE_FB
|
2020-07-04 15:20:26 -05:00
|
|
|
|
|
|
|
(* blackbox *)
|
|
|
|
module GCLKBUF (
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
input PAD,
|
|
|
|
input EN,
|
|
|
|
(* clkbuf_driver *)
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
(* blackbox *)
|
|
|
|
module GCLKBUF_DIFF (
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
input PADP,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
input PADN,
|
|
|
|
input EN,
|
|
|
|
(* clkbuf_driver *)
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
(* blackbox *)
|
|
|
|
module GCLKBIBUF (
|
|
|
|
input D,
|
|
|
|
input E,
|
|
|
|
input EN,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
inout PAD,
|
|
|
|
(* clkbuf_driver *)
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
endmodule
|
|
|
|
|
2019-03-06 18:18:49 -06:00
|
|
|
// module DFN1
|
|
|
|
// module DFN1C0
|
|
|
|
// module DFN1E1
|
|
|
|
// module DFN1E1C0
|
|
|
|
// module DFN1E1P0
|
|
|
|
// module DFN1P0
|
|
|
|
// module DLN1
|
|
|
|
// module DLN1C0
|
|
|
|
// module DLN1P0
|
|
|
|
|
|
|
|
module INV (
|
|
|
|
input A,
|
|
|
|
output Y
|
2018-10-31 09:28:57 -05:00
|
|
|
);
|
2019-03-06 18:18:49 -06:00
|
|
|
assign Y = !A;
|
2018-10-31 09:28:57 -05:00
|
|
|
endmodule
|
|
|
|
|
2019-03-06 18:18:49 -06:00
|
|
|
module INVD (
|
2018-10-31 09:28:57 -05:00
|
|
|
input A,
|
2019-03-06 18:18:49 -06:00
|
|
|
output Y
|
2018-10-31 09:28:57 -05:00
|
|
|
);
|
2019-03-06 18:18:49 -06:00
|
|
|
assign Y = !A;
|
2018-10-31 09:28:57 -05:00
|
|
|
endmodule
|
|
|
|
|
2019-03-06 18:18:49 -06:00
|
|
|
module MX2 (
|
|
|
|
input A, B, S,
|
|
|
|
output Y
|
2018-10-31 09:28:57 -05:00
|
|
|
);
|
2019-03-06 18:18:49 -06:00
|
|
|
assign Y = S ? B : A;
|
2018-10-31 09:28:57 -05:00
|
|
|
endmodule
|
|
|
|
|
2019-03-06 18:18:49 -06:00
|
|
|
module MX4 (
|
|
|
|
input D0, D1, D2, D3, S0, S1,
|
|
|
|
output Y
|
2018-10-31 09:28:57 -05:00
|
|
|
);
|
2019-03-06 18:18:49 -06:00
|
|
|
assign Y = S1 ? (S0 ? D3 : D2) : (S0 ? D1 : D0);
|
2018-10-31 09:28:57 -05:00
|
|
|
endmodule
|
2019-01-17 07:38:37 -06:00
|
|
|
|
2019-03-06 18:18:49 -06:00
|
|
|
module NAND2 (
|
|
|
|
input A, B,
|
2019-03-06 02:41:02 -06:00
|
|
|
output Y
|
|
|
|
);
|
2019-03-06 18:18:49 -06:00
|
|
|
assign Y = !(A & B);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module NAND3 (
|
|
|
|
input A, B, C,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = !(A & B & C);
|
2019-03-06 02:41:02 -06:00
|
|
|
endmodule
|
|
|
|
|
2019-03-06 18:18:49 -06:00
|
|
|
module NAND4 (
|
|
|
|
input A, B, C, D,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = !(A & B & C & D);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module NOR2 (
|
|
|
|
input A, B,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = !(A | B);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module NOR3 (
|
|
|
|
input A, B, C,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = !(A | B | C);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module NOR4 (
|
|
|
|
input A, B, C, D,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = !(A | B | C | D);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module OR2 (
|
|
|
|
input A, B,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A | B;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module OR3 (
|
|
|
|
input A, B, C,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A | B | C;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module OR4 (
|
|
|
|
input A, B, C, D,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A | B | C | D;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module XOR2 (
|
|
|
|
input A, B,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A ^ B;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module XOR3 (
|
|
|
|
input A, B, C,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A ^ B ^ C;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module XOR4 (
|
|
|
|
input A, B, C, D,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A ^ B ^ C ^ D;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module XOR8 (
|
|
|
|
input A, B, C, D, E, F, G, H,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = A ^ B ^ C ^ D ^ E ^ F ^ G ^ H;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
// module UJTAG
|
2020-07-04 15:20:26 -05:00
|
|
|
|
|
|
|
module BIBUF (
|
|
|
|
input D,
|
|
|
|
input E,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
inout PAD,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign PAD = E ? D : 1'bz;
|
|
|
|
assign Y = PAD;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
(* blackbox *)
|
|
|
|
module BIBUF_DIFF (
|
|
|
|
input D,
|
|
|
|
input E,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
inout PADP,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
inout PADN,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module CLKBIBUF (
|
|
|
|
input D,
|
|
|
|
input E,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
inout PAD,
|
|
|
|
(* clkbuf_driver *)
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign PAD = E ? D : 1'bz;
|
|
|
|
assign Y = PAD;
|
|
|
|
endmodule
|
2019-03-06 18:18:49 -06:00
|
|
|
|
2019-01-17 07:38:37 -06:00
|
|
|
module CLKBUF (
|
2020-07-04 15:20:26 -05:00
|
|
|
(* iopad_external_pin *)
|
2019-01-17 07:38:37 -06:00
|
|
|
input PAD,
|
2020-07-04 15:20:26 -05:00
|
|
|
(* clkbuf_driver *)
|
2019-01-17 07:38:37 -06:00
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = PAD;
|
|
|
|
endmodule
|
|
|
|
|
2020-07-04 15:20:26 -05:00
|
|
|
(* blackbox *)
|
|
|
|
module CLKBUF_DIFF (
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
input PADP,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
input PADN,
|
|
|
|
(* clkbuf_driver *)
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
endmodule
|
2019-03-06 18:18:49 -06:00
|
|
|
|
2019-01-17 07:38:37 -06:00
|
|
|
module INBUF (
|
2020-07-04 15:20:26 -05:00
|
|
|
(* iopad_external_pin *)
|
2019-01-17 07:38:37 -06:00
|
|
|
input PAD,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
assign Y = PAD;
|
|
|
|
endmodule
|
|
|
|
|
2020-07-04 15:20:26 -05:00
|
|
|
(* blackbox *)
|
|
|
|
module INBUF_DIFF (
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
input PADP,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
input PADN,
|
|
|
|
output Y
|
|
|
|
);
|
|
|
|
endmodule
|
2019-03-06 18:18:49 -06:00
|
|
|
|
2019-01-17 07:38:37 -06:00
|
|
|
module OUTBUF (
|
|
|
|
input D,
|
2020-07-04 15:20:26 -05:00
|
|
|
(* iopad_external_pin *)
|
2019-01-17 07:38:37 -06:00
|
|
|
output PAD
|
|
|
|
);
|
|
|
|
assign PAD = D;
|
|
|
|
endmodule
|
2019-03-06 18:18:49 -06:00
|
|
|
|
2020-07-04 15:20:26 -05:00
|
|
|
(* blackbox *)
|
|
|
|
module OUTBUF_DIFF (
|
|
|
|
input D,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
output PADP,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
output PADN
|
|
|
|
);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module TRIBUFF (
|
|
|
|
input D,
|
|
|
|
input E,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
output PAD
|
|
|
|
);
|
|
|
|
assign PAD = E ? D : 1'bz;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
(* blackbox *)
|
|
|
|
module TRIBUFF_DIFF (
|
|
|
|
input D,
|
|
|
|
input E,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
output PADP,
|
|
|
|
(* iopad_external_pin *)
|
|
|
|
output PADN
|
|
|
|
);
|
|
|
|
endmodule
|
|
|
|
|
2019-03-06 18:18:49 -06:00
|
|
|
// module DDR_IN
|
|
|
|
// module DDR_OUT
|
|
|
|
// module RAM1K18
|
|
|
|
// module RAM64x18
|
|
|
|
// module MACC
|