26 Description = QObject::tr (
"4bit highest priority encoder (binary form) verilog device");
29 QObject::tr (
"transfer function scaling factor")));
31 QObject::tr (
"output delay")
32 +
" ("+QObject::tr (
"s")+
")"));
37 Model =
"hpribin4bit";
44 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
51 Name = QObject::tr(
"4Bit HPRI-Bin");
52 BitmapFile = (
char *)
"hpribin4bit";
60 Lines.append(
new Line(-40, -50, 40,-50,QPen(Qt::darkBlue,2)));
61 Lines.append(
new Line( 40, -50, 40, 60,QPen(Qt::darkBlue,2)));
62 Lines.append(
new Line( 40, 60,-40, 60,QPen(Qt::darkBlue,2)));
63 Lines.append(
new Line(-40, 60,-40, -50,QPen(Qt::darkBlue,2)));
65 Lines.append(
new Line(-60,-10,-40,-10,QPen(Qt::darkBlue,2)));
66 Lines.append(
new Line(-60, 10,-40, 10,QPen(Qt::darkBlue,2)));
67 Lines.append(
new Line(-60, 30,-40, 30,QPen(Qt::darkBlue,2)));
68 Lines.append(
new Line(-60, 50,-40, 50,QPen(Qt::darkBlue,2)));
69 Lines.append(
new Line( 40, 30, 60, 30,QPen(Qt::darkBlue,2)));
70 Lines.append(
new Line( 40, 10, 60, 10,QPen(Qt::darkBlue,2)));
71 Lines.append(
new Line( 40,-10, 60,-10,QPen(Qt::darkBlue,2)));
73 Texts.append(
new Text(-35,-45,
"HPRI/BIN", Qt::darkBlue, 12.0));
75 Texts.append(
new Text(-35,-23,
"0", Qt::darkBlue, 12.0));
76 Texts.append(
new Text(-35, -3,
"1", Qt::darkBlue, 12.0));
77 Texts.append(
new Text(-35, 17,
"2", Qt::darkBlue, 12.0));
78 Texts.append(
new Text(-35, 37,
"3", Qt::darkBlue, 12.0));
80 Texts.append(
new Text( 25, 17,
"V", Qt::darkBlue, 12.0));
81 Texts.append(
new Text( 25, -3,
"Y", Qt::darkBlue, 12.0));
82 Texts.append(
new Text( 25,-23,
"X", Qt::darkBlue, 12.0));
100 QString td =
Props.at(1)->Value;
104 QString A =
Ports.at(0)->Connection->Name;
105 QString B =
Ports.at(1)->Connection->Name;
106 QString C =
Ports.at(2)->Connection->Name;
107 QString D =
Ports.at(3)->Connection->Name;
108 QString V =
Ports.at(4)->Connection->Name;
109 QString Y =
Ports.at(5)->Connection->Name;
110 QString X =
Ports.at(6)->Connection->Name;
112 s =
"\n "+
Name+
":process ("+A+
", "+B+
", "+C+
", "+D+
")\n"+
114 " "+X+
" <= "+D+
" or "+C+td+
115 " "+Y+
" <= "+D+
" or ((not "+C+
") and "+B+
")"+td+
116 " "+V+
" <= "+D+
" or "+C+
" or "+B+
" or "+A+td+
123 QString td =
Props.at(1)->Value;
128 QString A =
Ports.at(0)->Connection->Name;
129 QString B =
Ports.at(1)->Connection->Name;
130 QString C =
Ports.at(2)->Connection->Name;
131 QString D =
Ports.at(3)->Connection->Name;
132 QString V =
Ports.at(4)->Connection->Name;
133 QString Y =
Ports.at(5)->Connection->Name;
134 QString X =
Ports.at(6)->Connection->Name;
136 QString VR =
"V_reg" +
Name + V;
137 QString YR =
"Y_reg" +
Name + Y;
138 QString XR =
"X_reg" +
Name + X;
140 l =
"\n // "+
Name+
" 4bit hpribin\n"+
141 " assign "+V+
" = "+VR+
";\n"+
142 " reg "+VR+
" = 0;\n"+
143 " assign "+Y+
" = "+YR+
";\n"+
144 " reg "+YR+
" = 0;\n"+
145 " assign "+X+
" = "+XR+
";\n"+
146 " reg "+XR+
" = 0;\n"+
147 " always @ ("+A+
" or "+B+
" or "+C+
" or "+D+
")\n"+
149 " " +XR+
" <="+td+
" "+D+
" || "+C+
";\n"+
150 " " +YR+
" <="+td+
" "+D+
" || ((~"+C+
") && "+B+
");\n" +
151 " " +VR+
" <="+td+
" "+D+
" || "+C+
" || "+B+
" || "+A+
";\n"+
bool VHDL_Delay(QString &td, const QString &Name)
bool Verilog_Delay(QString &td, const QString &Name)
Definitions and declarations for the main application.
Q3PtrList< Property > Props
static Element * info(QString &, char *&, bool getNewOne=false)
Superclass of all schematic drawing elements.
virtual void recreate(Schematic *)