19 Description = QObject::tr (
"2bit pattern generator verilog device");
22 QObject::tr (
"pad output value")));
34 p->
Props.getFirst()->Value =
Props.getFirst()->Value;
41 Name = QObject::tr(
"2Bit Pattern");
42 BitmapFile = (
char *)
"pad2bit";
44 if(getNewOne)
return new pad2bit();
50 Lines.append(
new Line(-60, -50, 30,-50,QPen(QPen::darkGreen,2)));
51 Lines.append(
new Line( 30, -50, 30, 10,QPen(QPen::darkGreen,2)));
52 Lines.append(
new Line( 30, 10,-60, 10,QPen(QPen::darkGreen,2)));
53 Lines.append(
new Line(-60, 10,-60,-50,QPen(QPen::darkGreen,2)));
55 Lines.append(
new Line( 40,-30, 30,-30,QPen(QPen::darkGreen,2)));
56 Lines.append(
new Line( 40,-10, 30,-10,QPen(QPen::darkGreen,2)));
58 Texts.append(
new Text(-58,-33,
" 0 1 2 3", QPen::darkGreen, 12.0));
69 QString v =
Props.at(0)->Value; ;
70 QString s1, s2, s3,
s =
"";
72 QString
A =
Ports.at(0)->Connection->Name;
73 QString
B =
Ports.at(1)->Connection->Name;
75 s1 =
"\n "+
Name+
":process\n"+
76 " variable n_" +
Name +
" : integer := " + v +
";\n" +
78 s2 =
" case n_" +
Name +
" is\n" +
79 " when 0 => "+A+
" <= '0'; "+B+
" <= '0';\n" +
80 " when 1 => "+A+
" <= '0'; "+B+
" <= '1';\n" +
81 " when 2 => "+A+
" <= '1'; "+B+
" <= '0';\n" +
82 " when 3 => "+A+
" <= '1'; "+B+
" <= '1';\n" +
83 " when others => null;\n" +
85 s3 =
" end process;\n";
92 QString v =
Props.at(0)->Value;
97 QString
A =
Ports.at(0)->Connection->Name;
98 QString
B =
Ports.at(1)->Connection->Name;
100 QString AR =
"A_reg" +
Name +
A;
101 QString BR =
"Y_reg" +
Name +
B;
104 l1 =
"\n // "+
Name+
" 2bit pattern generator\n"+
105 " assign "+A+
" = "+AR+
";\n"+
106 " reg "+AR+
" = 0;\n"+
107 " assign "+B+
" = "+BR+
";\n"+
108 " reg "+BR+
" = 0;\n"+
112 " 0 : begin "+AR+
" = 0; "+BR+
" = 0; end\n"+
113 " 1 : begin "+AR+
" = 0; "+BR+
" = 1; end\n"+
114 " 2 : begin "+AR+
" = 1; "+BR+
" = 0; end\n"+
115 " 3 : begin "+AR+
" = 1; "+BR+
" = 1; end\n"+