19 Description = QObject::tr (
"3bit pattern generator verilog device");
22 QObject::tr (
"pad output value")));
34 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
41 Name = QObject::tr(
"3Bit Pattern");
42 BitmapFile = (
char *)
"pad3bit";
44 if(getNewOne)
return new pad3bit();
50 Lines.append(
new Line(-60, -50, 30,-50,QPen(Qt::darkGreen,2)));
51 Lines.append(
new Line( 30, -50, 30, 30,QPen(Qt::darkGreen,2)));
52 Lines.append(
new Line( 30, 30,-60, 30,QPen(Qt::darkGreen,2)));
53 Lines.append(
new Line(-60, 30,-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)));
59 Texts.append(
new Text(-58,-33,
" 0 1 2 3", Qt::darkGreen, 12.0));
60 Texts.append(
new Text(-58, -8,
" 4 5 6 7", Qt::darkGreen, 12.0));
72 QString v =
Props.at(0)->Value;
73 QString s1, s2, s3, s =
"";
75 QString A =
Ports.at(0)->Connection->Name;
76 QString B =
Ports.at(1)->Connection->Name;
77 QString C =
Ports.at(2)->Connection->Name;
79 s1 =
"\n "+
Name+
":process\n"+
80 " variable n_" +
Name +
" : integer := " + v +
";\n" +
82 s2 =
" case n_" +
Name +
" is\n" +
83 " when 0 => "+A+
" <= '0'; "+B+
" <= '0'; "+C+
" <= '0';\n"+
84 " when 1 => "+A+
" <= '0'; "+B+
" <= '0'; "+C+
" <= '1';\n"+
85 " when 2 => "+A+
" <= '0'; "+B+
" <= '1'; "+C+
" <= '0';\n"+
86 " when 3 => "+A+
" <= '0'; "+B+
" <= '1'; "+C+
" <= '1';\n"+
87 " when 4 => "+A+
" <= '1'; "+B+
" <= '0'; "+C+
" <= '0';\n"+
88 " when 5 => "+A+
" <= '1'; "+B+
" <= '0'; "+C+
" <= '1';\n"+
89 " when 6 => "+A+
" <= '1'; "+B+
" <= '1'; "+C+
" <= '0';\n"+
90 " when 7 => "+A+
" <= '1'; "+B+
" <= '1'; "+C+
" <= '1';\n"+
91 " when others => null;\n" +
93 s3 =
" end process;\n";
100 QString v =
Props.at(0)->Value;
105 QString A =
Ports.at(0)->Connection->Name;
106 QString B =
Ports.at(1)->Connection->Name;
107 QString C =
Ports.at(2)->Connection->Name;
109 QString AR =
"A_reg" +
Name + A;
110 QString BR =
"Y_reg" +
Name + B;
111 QString CR =
"Y_reg" +
Name + C;
113 l1 =
"\n // "+
Name+
" 3bit pattern generator\n"+
114 " assign "+A+
" = "+AR+
";\n"+
115 " reg "+AR+
" = 0;\n"+
116 " assign "+B+
" = "+BR+
";\n"+
117 " reg "+BR+
" = 0;\n"+
118 " assign "+C+
" = "+CR+
";\n"+
119 " reg "+CR+
" = 0;\n"+
123 " 0 : begin "+AR+
" = 0; "+BR+
" = 0; "+CR+
" = 0; end\n"+
124 " 1 : begin "+AR+
" = 0; "+BR+
" = 0; "+CR+
" = 1; end\n"+
125 " 2 : begin "+AR+
" = 0; "+BR+
" = 1; "+CR+
" = 0; end\n"+
126 " 3 : begin "+AR+
" = 0; "+BR+
" = 1; "+CR+
" = 1; end\n"+
127 " 4 : begin "+AR+
" = 1; "+BR+
" = 0; "+CR+
" = 0; end\n"+
128 " 5 : begin "+AR+
" = 1; "+BR+
" = 0; "+CR+
" = 1; end\n"+
129 " 6 : begin "+AR+
" = 1; "+BR+
" = 1; "+CR+
" = 0; end\n"+
130 " 7 : begin "+AR+
" = 1; "+BR+
" = 1; "+CR+
" = 1; end\n"+
static Element * info(QString &, char *&, bool getNewOne=false)
Definitions and declarations for the main application.
Q3PtrList< Property > Props
Superclass of all schematic drawing elements.
virtual void recreate(Schematic *)