📄 ecu_new.v
字号:
//------------------------------------------------------------------------------
//
// File : ecu_new.v
// Last Modification: 12/10/2002
//
// Created In SpDE Version: SpDE 9.3.2
// Author : Stanley Hung, QuickLogic Corporation
// Copyright (C) 2002, Licensed customers of QuickLogic may copy and modify
// this file for use in designing with QuickLogic devices only.
//
// IMPORTANT NOTICE: DISCLAIMER OF WARRANTY
// This design is provided without warranty of any kind. QuickLogic
// Corporation does not warrant, guarantee or make any representations
// regarding the use, or the results of the use, of this design. QuickLogic
// disclaims all implied warranties, including but not limited to implied
// warranties of merchantability and fitness for a particular purpose.
// In addition and without limiting the generality of the foregoing,
// QuickLogic does not make any warranty of any kind that any item developed
// based on this design, or any portion of it, will not infringe any
// copyright, patent, trade secret or other intellectual property right of
// any person or entity in any country. It is the responsibility of the user
// of the design to seek licenses for such intellectual property rights where
// applicable. QuickLogic shall not be liable for any damages arising out of
// or in connection with the use of the design including liability for lost
// profit, business interruption, or any other damages whatsoever.
//
// Description :
// ECU macro with reset logic.
//
// History:
// Date Author Version
// 12/10/02 Stanley Hung 1.0
// - Header added to conform to coding standard.
//
//------------------------------------------------------------------------------
`timescale 1ns/1ns
`define LOGIC 1
`define BIDIR 2
`define INCELL 3
`define CLOCK 4
`define HSCK 5
`define CLOCKB 6
`define ESPXCLKIN 7
`define HSCKMUX 8
`define IOCONTROL 9
`include "C:\pasic\spde\data\ecu.v"
module ecu_new( A , B, CIN, CLK, RESET, S1, S2, S3, SIGN1, SIGN2, Q );
input [15:0] A;
input [15:0] B;
input CIN, CLK;
output [16:0] Q;
input RESET, S1, S2, S3, SIGN1, SIGN2;
wire [15:0] Bout;
wire [15:0] A_out;
wire ecureset;
wire mode;
supply0 GND;
wire CIN_out;
wire s1_out;
wire s2_out;
wire s3_out;
mux2x0 I47 ( .A(GND), .B(mode), .Q(ecureset), .S(RESET) );
and2i1 I46 ( .A(S2), .B(S3), .Q(mode) );
reset_ecu I51 ( .A({ A[15:0] }), .A_out({ A_out[15:0] }), .B({ B[15:0] }),
.Bout({ Bout[15:0] }), .CIN(CIN), .CIN_out(CIN_out), .CLK(CLK),
.ecureset(ecureset), .S1(S1), .s1_out(s1_out), .S2(S2),
.s2_out(s2_out), .S3(S3), .s3_out(s3_out) );
ECU I3 ( .A({ A_out[15:0] }), .B({ Bout[15:0] }), .CIN(CIN_out), .CLK(CLK),
.Q({ Q[16:0] }), .RESET(GND), .S1(s1_out), .S2(s2_out), .S3(s3_out),
.SIGN1(SIGN1), .SIGN2(SIGN2) );
endmodule // ecu_new
`ifdef mux2x0
`else
`define mux2x0
module mux2x0( A , B, S, Q );
input A, B;
output Q;
input S;
parameter ql_gate = `LOGIC;
wire N_1;
supply1 VCC;
supply0 GND;
wire N_2;
frag_f I_2 ( .F1(S), .F2(GND), .F3(VCC), .F4(GND), .F5(VCC), .F6(GND), .FZ(N_1) );
frag_m I_1 ( .B1(VCC), .B2(GND), .C1(VCC), .C2(GND), .D1(A), .D2(GND), .E1(B),
.E2(GND), .NS(N_1), .NZ(Q), .OS(N_2) );
frag_a QL3 ( .A1(VCC), .A2(GND), .A3(VCC), .A4(GND), .A5(VCC), .A6(GND), .AZ(N_2) );
endmodule // mux2x0
`endif
`ifdef and2i1
`else
`define and2i1
module and2i1( A , B, Q );
input A, B;
output Q;
parameter ql_gate = `LOGIC;
supply1 VCC;
supply0 GND;
frag_a QL1 ( .A1(A), .A2(GND), .A3(VCC), .A4(GND), .A5(VCC), .A6(B), .AZ(Q) );
endmodule // and2i1
`endif
`ifdef reset_ecu
`else
`define reset_ecu
module reset_ecu( A , B, CIN, CLK, ecureset, S1, S2, S3, A_out, Bout, CIN_out,
s1_out, s2_out, s3_out );
input [15:0] A;
output [15:0] A_out;
input [15:0] B;
output [15:0] Bout;
input CIN;
output CIN_out;
input CLK, ecureset, S1;
output s1_out;
input S2;
output s2_out;
input S3;
output s3_out;
parameter syn_macro = 1, ql_pack = 1;
supply1 VCC;
wire sync_reset_out;
supply0 GND;
wire sync_reset_rep2;
wire sync_reset_rep1;
wire sync_reset_rep5;
wire sync_reset_rep;
wire sync_reset_rep4;
wire sync_reset_rep6;
wire sync_reset;
wire sync_reset_rep3;
mux2x0 I48 ( .A(S3), .B(VCC), .Q(s3_out), .S(sync_reset_out) );
mux2x0 I50 ( .A(S1), .B(VCC), .Q(s1_out), .S(sync_reset_out) );
mux2x0 I49 ( .A(S2), .B(VCC), .Q(s2_out), .S(sync_reset_out) );
mux2x0 I54 ( .A(A[4]), .B(GND), .Q(A_out[4]), .S(sync_reset) );
mux2x0 I55 ( .A(B[4]), .B(GND), .Q(Bout[4]), .S(sync_reset_rep3) );
dff I38 ( .CLK(CLK), .D(ecureset), .Q(sync_reset_rep3) );
dff I39 ( .CLK(CLK), .D(ecureset), .Q(sync_reset_rep4) );
dff I51 ( .CLK(CLK), .D(ecureset), .Q(sync_reset_out) );
dff I52 ( .CLK(CLK), .D(ecureset), .Q(sync_reset_rep5) );
dff I53 ( .CLK(CLK), .D(ecureset), .Q(sync_reset_rep6) );
dff I40 ( .CLK(CLK), .D(ecureset), .Q(sync_reset_rep1) );
dff I41 ( .CLK(CLK), .D(ecureset), .Q(sync_reset_rep2) );
dff I13 ( .CLK(CLK), .D(ecureset), .Q(sync_reset_rep) );
dff I12 ( .CLK(CLK), .D(ecureset), .Q(sync_reset) );
and2i1 I42 ( .A(CIN), .B(sync_reset_out), .Q(CIN_out) );
and2i1 I33 ( .A(A[3]), .B(sync_reset), .Q(A_out[3]) );
and2i1 I30 ( .A(A[0]), .B(sync_reset), .Q(A_out[0]) );
and2i1 I31 ( .A(A[1]), .B(sync_reset), .Q(A_out[1]) );
and2i1 I32 ( .A(A[2]), .B(sync_reset), .Q(A_out[2]) );
and2i1 I35 ( .A(A[5]), .B(sync_reset_rep), .Q(A_out[5]) );
and2i1 I36 ( .A(A[6]), .B(sync_reset_rep), .Q(A_out[6]) );
and2i1 I37 ( .A(A[7]), .B(sync_reset_rep), .Q(A_out[7]) );
and2i1 I4 ( .A(A[8]), .B(sync_reset_rep), .Q(A_out[8]) );
and2i1 I5 ( .A(A[9]), .B(sync_reset_rep1), .Q(A_out[9]) );
and2i1 I6 ( .A(A[10]), .B(sync_reset_rep1), .Q(A_out[10]) );
and2i1 I7 ( .A(A[11]), .B(sync_reset_rep1), .Q(A_out[11]) );
and2i1 I8 ( .A(A[12]), .B(sync_reset_rep1), .Q(A_out[12]) );
and2i1 I9 ( .A(A[13]), .B(sync_reset_rep2), .Q(A_out[13]) );
and2i1 I10 ( .A(A[14]), .B(sync_reset_rep2), .Q(A_out[14]) );
and2i1 I11 ( .A(A[15]), .B(sync_reset_rep2), .Q(A_out[15]) );
and2i1 I29 ( .A(B[15]), .B(sync_reset_rep6), .Q(Bout[15]) );
and2i1 I27 ( .A(B[13]), .B(sync_reset_rep6), .Q(Bout[13]) );
and2i1 I28 ( .A(B[14]), .B(sync_reset_rep6), .Q(Bout[14]) );
and2i1 I14 ( .A(B[0]), .B(sync_reset_rep3), .Q(Bout[0]) );
and2i1 I15 ( .A(B[1]), .B(sync_reset_rep3), .Q(Bout[1]) );
and2i1 I16 ( .A(B[2]), .B(sync_reset_rep3), .Q(Bout[2]) );
and2i1 I17 ( .A(B[3]), .B(sync_reset_rep3), .Q(Bout[3]) );
and2i1 I19 ( .A(B[5]), .B(sync_reset_rep4), .Q(Bout[5]) );
and2i1 I20 ( .A(B[6]), .B(sync_reset_rep4), .Q(Bout[6]) );
and2i1 I21 ( .A(B[7]), .B(sync_reset_rep4), .Q(Bout[7]) );
and2i1 I22 ( .A(B[8]), .B(sync_reset_rep4), .Q(Bout[8]) );
and2i1 I23 ( .A(B[9]), .B(sync_reset_rep5), .Q(Bout[9]) );
and2i1 I24 ( .A(B[10]), .B(sync_reset_rep5), .Q(Bout[10]) );
and2i1 I25 ( .A(B[11]), .B(sync_reset_rep5), .Q(Bout[11]) );
and2i1 I26 ( .A(B[12]), .B(sync_reset_rep5), .Q(Bout[12]) );
endmodule // reset_ecu
`endif
`ifdef frag_f
`else
`define frag_f
module frag_f( F1 , F2, F3, F4, F5, F6, FZ );
input F1, F2, F3, F4, F5, F6;
output FZ;
parameter ql_frag = 1;
assign #1 FZ = F1 & ~F2 & F3 & ~F4 & F5 & ~F6;
endmodule // frag_f
`endif
`ifdef frag_m
`else
`define frag_m
module frag_m( B1 , B2, C1, C2, D1, D2, E1, E2, NS, OS, NZ, OZ );
input B1, B2, C1, C2, D1, D2, E1, E2, NS;
output NZ;
input OS;
output OZ;
parameter ql_frag = 1;
assign #1 NZ = NS ? (E1 & ~E2):(D1 & ~D2);
assign #1 OZ = OS ? NZ:(NS ? (C1 & ~C2):(B1 & ~B2));
endmodule // frag_m
`endif
`ifdef frag_a
`else
`define frag_a
module frag_a( A1 , A2, A3, A4, A5, A6, AZ );
input A1, A2, A3, A4, A5, A6;
output AZ;
parameter ql_frag = 1;
assign #1 AZ = A1 & ~A2 & A3 & ~A4 & A5 & ~A6;
endmodule // frag_a
`endif
`ifdef dff
`else
`define dff
module dff( CLK , D, Q );
input CLK, D;
output Q;
parameter ql_gate = `LOGIC;
supply0 GND;
wire N_1;
supply1 VCC;
wire N_2;
wire N_3;
frag_m I_3 ( .B1(VCC), .B2(GND), .C1(VCC), .C2(GND), .D1(VCC), .D2(GND), .E1(D),
.E2(GND), .NS(N_2), .OS(N_3), .OZ(N_1) );
frag_q I_2 ( .QC(CLK), .QD(N_1), .QR(GND), .QS(GND), .QZ(Q) );
frag_a I_1 ( .A1(VCC), .A2(GND), .A3(VCC), .A4(GND), .A5(VCC), .A6(GND), .AZ(N_3) );
frag_f QL1 ( .F1(VCC), .F2(GND), .F3(VCC), .F4(GND), .F5(VCC), .F6(GND), .FZ(N_2) );
endmodule // dff
`endif
`ifdef frag_q
`else
`define frag_q
module frag_q( QC , QD, QR, QS, QZ );
input QC, QD, QR, QS;
output QZ;
parameter ql_frag = 1;
reg QZ;
`ifdef synthesis
always @ (posedge QC or posedge QR or posedge QS)
if (QR)
#1 QZ = 1'b0;
else if (QS)
#1 QZ = 1'b1;
else #1 QZ = QD;
`else
always @ (QR or QS) begin
if (QR)
#1 assign QZ = 1'b0;
else if (QS)
#1 assign QZ = 1'b1;
else
#1 deassign QZ;
end
always @ (posedge QC)
QZ = #1 QD;
initial begin
#1;
if (QR)
#1 assign QZ = 1'b0;
else if (QS)
#1 assign QZ = 1'b1;
end
`endif
endmodule // frag_q
`endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -