19 Description = QObject::tr (
"4bit pattern generator verilog device");
22 QObject::tr (
"pad output value")));
34 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
41 Name = QObject::tr(
"4Bit Pattern");
42 BitmapFile = (
char *)
"pad4bit";
44 if(getNewOne)
return new pad4bit();
50 Lines.append(
new Line(-60, -50, 30,-50,QPen(Qt::darkGreen,2)));
51 Lines.append(
new Line( 30, -50, 30, 50,QPen(Qt::darkGreen,2)));
52 Lines.append(
new Line( 30, 50,-60, 50,QPen(Qt::darkGreen,2)));
53 Lines.append(
new Line(-60, 50,-60,-50,QPen(Qt::darkGreen,2)));
55 Lines.append(
new Line( 40,-30, 30,-30,QPen(Qt::darkGreen,2)));
56 Lines.append(
new Line( 40,-10, 30,-10,QPen(Qt::darkGreen,2)));
57 Lines.append(
new Line( 40, 10, 30, 10,QPen(Qt::darkGreen,2)));
58 Lines.append(
new Line( 40, 30, 30, 30,QPen(Qt::darkGreen,2)));
60 Texts.append(
new Text(-58,-46,
" 0 1 2 3", Qt::darkGreen, 12.0));
61 Texts.append(
new Text(-58,-23,
" 4 5 6 7", Qt::darkGreen, 12.0));
62 Texts.append(
new Text(-58, 0,
" 8 9 10 11", Qt::darkGreen, 12.0));
63 Texts.append(
new Text(-58, 23,
"12 13 14 15", Qt::darkGreen, 12.0));
76 QString v =
Props.at(0)->Value;
77 QString s1, s2, s3, s =
"";
79 QString A =
Ports.at(0)->Connection->Name;
80 QString B =
Ports.at(1)->Connection->Name;
81 QString C =
Ports.at(2)->Connection->Name;
82 QString D =
Ports.at(3)->Connection->Name;
84 s1 =
"\n "+
Name+
":process\n"+
85 " variable n_" +
Name +
" : integer := " + v +
";\n" +
87 s2 =
" case n_" +
Name +
" is\n" +
88 " when 0 => "+A+
" <= '0'; "+B+
" <= '0'; "+C+
" <= '0'; "+D+
" <= '0';\n"+
89 " when 1 => "+A+
" <= '0'; "+B+
" <= '0'; "+C+
" <= '0'; "+D+
" <= '1';\n"+
90 " when 2 => "+A+
" <= '0'; "+B+
" <= '0'; "+C+
" <= '1'; "+D+
" <= '0';\n"+
91 " when 3 => "+A+
" <= '0'; "+B+
" <= '0'; "+C+
" <= '1'; "+D+
" <= '1';\n"+
92 " when 4 => "+A+
" <= '0'; "+B+
" <= '1'; "+C+
" <= '0'; "+D+
" <= '0';\n"+
93 " when 5 => "+A+
" <= '0'; "+B+
" <= '1'; "+C+
" <= '0'; "+D+
" <= '1';\n"+
94 " when 6 => "+A+
" <= '0'; "+B+
" <= '1'; "+C+
" <= '1'; "+D+
" <= '0';\n"+
95 " when 7 => "+A+
" <= '0'; "+B+
" <= '1'; "+C+
" <= '1'; "+D+
" <= '1';\n"+
96 " when 8 => "+A+
" <= '1'; "+B+
" <= '0'; "+C+
" <= '0'; "+D+
" <= '0';\n"+
97 " when 9 => "+A+
" <= '1'; "+B+
" <= '0'; "+C+
" <= '0'; "+D+
" <= '1';\n"+
98 " when 10 => "+A+
" <= '1'; "+B+
" <= '0'; "+C+
" <= '1'; "+D+
" <= '0';\n"+
99 " when 11 => "+A+
" <= '1'; "+B+
" <= '0'; "+C+
" <= '1'; "+D+
" <= '1';\n"+
100 " when 12 => "+A+
" <= '1'; "+B+
" <= '1'; "+C+
" <= '0'; "+D+
" <= '0';\n"+
101 " when 13 => "+A+
" <= '1'; "+B+
" <= '1'; "+C+
" <= '0'; "+D+
" <= '1';\n"+
102 " when 14 => "+A+
" <= '1'; "+B+
" <= '1'; "+C+
" <= '1'; "+D+
" <= '0';\n"+
103 " when 15 => "+A+
" <= '1'; "+B+
" <= '1'; "+C+
" <= '1'; "+D+
" <= '1';\n"+
104 " when others => null;\n"
106 s3 =
" end process;\n";
113 QString v =
Props.at(0)->Value;
118 QString A =
Ports.at(0)->Connection->Name;
119 QString B =
Ports.at(1)->Connection->Name;
120 QString C =
Ports.at(2)->Connection->Name;
121 QString D =
Ports.at(3)->Connection->Name;
123 QString AR =
"A_reg" +
Name + A;
124 QString BR =
"B_reg" +
Name + B;
125 QString CR =
"C_reg" +
Name + C;
126 QString DR =
"C_reg" +
Name + D;
128 l1 =
"\n // "+
Name+
" 4bit pattern generator\n"+
129 " assign "+A+
" = "+AR+
";\n"+
130 " reg "+AR+
" = 0;\n"+
131 " assign "+B+
" = "+BR+
";\n"+
132 " reg "+BR+
" = 0;\n"+
133 " assign "+C+
" = "+CR+
";\n"+
134 " reg "+CR+
" = 0;\n"+
135 " assign "+D+
" = "+DR+
";\n"+
136 " reg "+DR+
" = 0;\n"+
140 " 0 : begin "+AR+
" = 0; "+BR+
" = 0; "+CR+
" = 0; "+DR+
" = 0; end\n"+
141 " 1 : begin "+AR+
" = 0; "+BR+
" = 0; "+CR+
" = 0; "+DR+
" = 1; end\n"+
142 " 2 : begin "+AR+
" = 0; "+BR+
" = 0; "+CR+
" = 1; "+DR+
" = 0; end\n"+
143 " 3 : begin "+AR+
" = 0; "+BR+
" = 0; "+CR+
" = 1; "+DR+
" = 1; end\n"+
144 " 4 : begin "+AR+
" = 0; "+BR+
" = 1; "+CR+
" = 0; "+DR+
" = 0; end\n"+
145 " 5 : begin "+AR+
" = 0; "+BR+
" = 1; "+CR+
" = 0; "+DR+
" = 1; end\n"+
146 " 6 : begin "+AR+
" = 0; "+BR+
" = 1; "+CR+
" = 1; "+DR+
" = 0; end\n"+
147 " 7 : begin "+AR+
" = 0; "+BR+
" = 1; "+CR+
" = 1; "+DR+
" = 1; end\n"+
148 " 8 : begin "+AR+
" = 1; "+BR+
" = 0; "+CR+
" = 0; "+DR+
" = 0; end\n"+
149 " 9 : begin "+AR+
" = 1; "+BR+
" = 0; "+CR+
" = 0; "+DR+
" = 1; end\n"+
150 " 10 : begin "+AR+
" = 1; "+BR+
" = 0; "+CR+
" = 1; "+DR+
" = 0; end\n"+
151 " 11 : begin "+AR+
" = 1; "+BR+
" = 0; "+CR+
" = 1; "+DR+
" = 1; end\n"+
152 " 12 : begin "+AR+
" = 1; "+BR+
" = 1; "+CR+
" = 0; "+DR+
" = 0; end\n"+
153 " 13 : begin "+AR+
" = 1; "+BR+
" = 1; "+CR+
" = 0; "+DR+
" = 1; end\n"+
154 " 14 : begin "+AR+
" = 1; "+BR+
" = 1; "+CR+
" = 1; "+DR+
" = 0; end\n"+
155 " 15 : begin "+AR+
" = 1; "+BR+
" = 1; "+CR+
" = 1; "+DR+
" = 1; end\n"+
Definitions and declarations for the main application.
Q3PtrList< Property > Props
Superclass of all schematic drawing elements.
virtual void recreate(Schematic *)
static Element * info(QString &, char *&, bool getNewOne=false)