26 Description = QObject::tr (
"T flip flop with set and reset 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")+
")"));
46 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
53 Name = QObject::tr(
"T-FlipFlop w/ SR");
54 BitmapFile = (
char *)
"tff_SR";
56 if(getNewOne)
return new tff_SR();
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)));
66 Lines.append(
new Line(-30, 40,-30,-40,QPen(Qt::darkBlue,2)));
68 Lines.append(
new Line(-50,-20,-30,-20,QPen(Qt::darkBlue,2)));
69 Lines.append(
new Line(-50, 20,-30, 20,QPen(Qt::darkBlue,2)));
70 Lines.append(
new Line( 30, 20, 50, 20,QPen(Qt::darkBlue,2)));
71 Lines.append(
new Line( 30,-20, 50,-20,QPen(Qt::darkBlue,2)));
73 Lines.append(
new Line( -30, 10,-20, 20,QPen(Qt::darkBlue,2)));
74 Lines.append(
new Line( -30, 30,-20, 20,QPen(Qt::darkBlue,2)));
76 Lines.append(
new Line( 0, -50, 0,-60,QPen(Qt::darkBlue,2)));
77 Lines.append(
new Line( 0, 50, 0, 60,QPen(Qt::darkBlue,2)));
79 Arcs.append(
new Arc( -5, -50, 10, 10, 0, 16*360, QPen(Qt::darkBlue,2)));
80 Arcs.append(
new Arc( -5, 40, 10, 10, 0, 16*360, QPen(Qt::darkBlue,2)));
82 Texts.append(
new Text(-25,-32,
"T", Qt::darkBlue, 12.0));
83 Texts.append(
new Text( 11,-32,
"Q", Qt::darkBlue, 12.0));
84 Texts.append(
new Text( -5,-39,
"S", Qt::darkBlue, 12.0));
85 Texts.append(
new Text( 11, 7,
"Q", Qt::darkBlue, 12.0));
86 Texts.current()->over=
true;
87 Texts.append(
new Text( -5, 17,
"R", Qt::darkBlue, 12.0));
104 QString td =
Props.at(2)->Value;
108 QString S =
Ports.at(0)->Connection->Name;
109 QString T =
Ports.at(1)->Connection->Name;
110 QString CLK =
Ports.at(2)->Connection->Name;
111 QString R =
Ports.at(3)->Connection->Name;
112 QString QB =
Ports.at(4)->Connection->Name;
113 QString Q =
Ports.at(5)->Connection->Name;
115 s =
"\n "+
Name+
" : process ("+S+
", "+CLK+
", "+R+
") is\n"+
116 " variable state : std_logic;\n"+
118 " if ("+S+
" = '0') then\n"+
120 " elsif ("+R+
" = '0') then\n"+
122 " elsif ("+CLK+
" = '1' and "+CLK+
"'event) then\n"+
123 " if ("+T+
" = '1') then state := not state;\n"+
126 " "+Q+
" <= state"+td+
127 " "+QB+
" <= not state"+td+
134 QString td =
Props.at(2)->Value;
139 QString S =
Ports.at(0)->Connection->Name;
140 QString T =
Ports.at(1)->Connection->Name;
141 QString CLK =
Ports.at(2)->Connection->Name;
142 QString R =
Ports.at(3)->Connection->Name;
143 QString QB =
Ports.at(4)->Connection->Name;
144 QString Q =
Ports.at(5)->Connection->Name;
146 QString QR =
"Q_reg" +
Name + Q;
147 QString QBR =
"QB_reg" +
Name + QB;
148 QString ST =
"Q_state" +
Name;
150 l =
"\n // "+
Name+
" t flip flop with set and reset\n"+
151 " assign "+Q+
" = "+QR+
";\n"+
152 " reg "+QR+
" = 0;\n"+
153 " assign "+QB+
" = "+QBR+
";\n"+
154 " reg "+QBR+
" = 1;\n"+
155 " reg "+ST+
" = 0;\n"+
156 " always @ (posedge "+CLK+
")\n"+
158 " if ("+T+
" == 1 && "+R+
" == 1 && "+S+
" == 1)\n"+
160 " "+ST+
" = ~"+ST+
";\n"+
161 " "+QR+
" <="+td+
" "+ST+
";\n"+
162 " "+QBR+
" <="+td+
" ~"+ST+
";\n"+
165 " always @ ("+R+
")\n"+
167 " if ("+R+
" == 0) "+ST+
" = 0;\n"+
168 " "+QR+
" <="+td+
" "+ST+
";\n"+
169 " "+QBR+
" <="+td+
" ~"+ST+
";\n"+
171 " always @ ("+S+
")\n"+
172 " begin if ("+S+
" == 0) "+ST+
" = 1;\n"+
173 " "+QR+
" <="+td+
" "+ST+
";\n"+
174 " "+QBR+
" <="+td+
" ~"+ST+
";\n"+
bool VHDL_Delay(QString &td, const QString &Name)
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.
static Element * info(QString &, char *&, bool getNewOne=false)
virtual void recreate(Schematic *)