26 Description = QObject::tr (
"D 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(
"D-FlipFlop w/ SR");
54 BitmapFile = (
char *)
"dff_SR";
56 if(getNewOne)
return new dff_SR();
63 Lines.append(
new Line(-30,-40, 30,-40,QPen(QPen::darkBlue,2)));
64 Lines.append(
new Line( 30,-40, 30, 40,QPen(QPen::darkBlue,2)));
65 Lines.append(
new Line( 30, 40,-30, 40,QPen(QPen::darkBlue,2)));
66 Lines.append(
new Line(-30, 40,-30,-40,QPen(QPen::darkBlue,2)));
68 Lines.append(
new Line(-50,-20,-30,-20,QPen(QPen::darkBlue,2)));
69 Lines.append(
new Line(-50, 20,-30, 20,QPen(QPen::darkBlue,2)));
70 Lines.append(
new Line( 30, 20, 50, 20,QPen(QPen::darkBlue,2)));
71 Lines.append(
new Line( 30,-20, 50,-20,QPen(QPen::darkBlue,2)));
73 Lines.append(
new Line( -30, 10,-20, 20,QPen(QPen::darkBlue,2)));
74 Lines.append(
new Line( -30, 30,-20, 20,QPen(QPen::darkBlue,2)));
76 Lines.append(
new Line( 0, -50, 0, -60,QPen(QPen::darkBlue,2)));
77 Lines.append(
new Line( 0, 50, 0, 60,QPen(QPen::darkBlue,2)));
79 Arcs.append(
new Arc( -5,-50, 10, 10, 0, 16*360, QPen(QPen::darkBlue,2)));
80 Arcs.append(
new Arc( -5, 40, 10, 10, 0, 16*360, QPen(QPen::darkBlue,2)));
82 Texts.append(
new Text(-25,-32,
"D", QPen::darkBlue, 12.0));
83 Texts.append(
new Text( 11,-32,
"Q", QPen::darkBlue, 12.0));
84 Texts.append(
new Text( -5,-39,
"S", QPen::darkBlue, 12.0));
85 Texts.append(
new Text( 11, 7,
"Q", QPen::darkBlue, 12.0));
86 Texts.current()->over=
true;
87 Texts.append(
new Text( -5, 17,
"R", QPen::darkBlue, 12.0));
104 QString td =
Props.at(2)->Value;
108 QString
S =
Ports.at(0)->Connection->Name;
109 QString
D =
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 " state := "+D+
";\n"+
125 " "+Q+
" <= state"+td+
126 " "+QB+
" <= not state"+td+
133 QString td =
Props.at(2)->Value;
138 QString
S =
Ports.at(0)->Connection->Name;
139 QString
D =
Ports.at(1)->Connection->Name;
140 QString
CLK =
Ports.at(2)->Connection->Name;
141 QString
R =
Ports.at(3)->Connection->Name;
142 QString
QB =
Ports.at(4)->Connection->Name;
143 QString
Q =
Ports.at(5)->Connection->Name;
145 QString QR =
"Q_reg" +
Name +
Q;
146 QString QBR =
"QB_reg" +
Name +
QB;
147 QString ST =
"Q_state" +
Name;
149 l =
"\n // "+
Name+
" d flip-flop with set and reset\n"+
150 " assign "+Q+
" = "+QR+
";\n"+
151 " reg "+QR+
" = 0;\n"+
152 " assign "+QB+
" = "+QBR+
";\n"+
153 " reg "+QBR+
" = 1;\n"+
154 " reg "+ST+
" = 0;\n"+
155 " always @ (posedge "+CLK+
")\n"+
157 " if ("+R+
" == 1 && "+S+
" == 1)\n"+
159 " "+ST+
" = "+D+
";\n"+
160 " "+QR+
" <="+td+
" "+ST+
";\n"+
161 " "+QBR+
" <="+td+
" ~"+ST+
";\n"+
164 " always @ ("+R+
")\n"+
166 " if ("+R+
" == 0) "+ST+
" = 0;\n"+
167 " "+QR+
" <="+td+
" "+ST+
";\n"+
168 " "+QBR+
" <="+td+
" ~"+ST+
";\n"+
170 " always @ ("+S+
")\n"+
171 " begin if ("+S+
" == 0) "+ST+
" = 1;\n"+
172 " "+QR+
" <="+td+
" "+ST+
";\n"+
173 " "+QBR+
" <="+td+
" ~"+ST+
";\n"+