26 Description = QObject::tr (
"gated D latch verilog device");
29 QObject::tr (
"cross coupled gate transfer function high scaling factor")));
31 QObject::tr (
"cross coupled gate transfer function low scaling factor")));
33 QObject::tr (
"cross coupled gate delay")
34 +
" ("+QObject::tr (
"s")+
")"));
39 Model =
"gatedDlatch";
46 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
53 Name = QObject::tr(
"Gated D-Latch");
54 BitmapFile = (
char *)
"gatedDlatch";
62 Lines.append(
new Line(-30, -40, 30,-40,QPen(Qt::darkBlue,2)));
63 Lines.append(
new Line( 30, -40, 30, 40,QPen(Qt::darkBlue,2)));
64 Lines.append(
new Line( 30, 40,-30, 40,QPen(Qt::darkBlue,2)));
65 Lines.append(
new Line(-30, 40,-30, -40,QPen(Qt::darkBlue,2)));
67 Lines.append(
new Line(-50,-20,-30,-20,QPen(Qt::darkBlue,2)));
68 Lines.append(
new Line(-50, 20,-30, 20,QPen(Qt::darkBlue,2)));
69 Lines.append(
new Line( 40, 20, 50, 20,QPen(Qt::darkBlue,2)));
70 Lines.append(
new Line( 30,-20, 50,-20,QPen(Qt::darkBlue,2)));
72 Arcs.append(
new Arc( 30, 15, 10, 10, 0, 16*360, QPen(Qt::darkBlue,2)));
74 Texts.append(
new Text(-25,-32,
"D", Qt::darkBlue, 12.0));
75 Texts.append(
new Text(-25, 7,
"C", Qt::darkBlue, 12.0));
76 Texts.append(
new Text( 11,-32,
"Q", Qt::darkBlue, 12.0));
77 Texts.append(
new Text( 11, 7,
"Q", Qt::darkBlue, 12.0));
78 Texts.current()->over=
true;
93 QString td =
Props.at(2)->Value;
97 QString D =
Ports.at(0)->Connection->Name;
98 QString C =
Ports.at(1)->Connection->Name;
99 QString QB =
Ports.at(2)->Connection->Name;
100 QString Q =
Ports.at(3)->Connection->Name;
102 s =
"\n "+
Name+
":process ("+D+
", "+C+
")\n"+
104 " if ("+C+
" = '1') then\n"+
106 " "+QB+
" <= not "+D+td+
114 QString td =
Props.at(2)->Value;
119 QString D =
Ports.at(0)->Connection->Name;
120 QString C =
Ports.at(1)->Connection->Name;
121 QString QB =
Ports.at(2)->Connection->Name;
122 QString Q =
Ports.at(3)->Connection->Name;
124 QString QR =
"Q_reg" +
Name + Q;
125 QString QBR =
"QB_reg" +
Name + QB;
127 l =
"\n // "+
Name+
" gated d latch\n"+
128 " assign "+Q+
" = "+QR+
";\n"+
129 " reg "+QR+
" = 0;\n"+
130 " assign "+QB+
" = "+QBR+
";\n"+
131 " reg "+QBR+
" = 0;\n"+
132 " always @ ("+D+
" or "+C+
")\n"+
134 " if ("+C+
" == 1)\n"+
136 " " +QR+
" <="+td+
" "+D+
";\n"+
137 " " +QBR+
" <="+td+
" ~"+D+
";\n" +
bool VHDL_Delay(QString &td, const QString &Name)
static Element * info(QString &, char *&, bool getNewOne=false)
Q3PtrList< struct Arc > Arcs
bool Verilog_Delay(QString &td, const QString &Name)
Definitions and declarations for the main application.
Q3PtrList< Property > Props
Superclass of all schematic drawing elements.
virtual void recreate(Schematic *)