mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 13:57:18 +02:00
Add structural EEQ gates (Stephan Boettcher)
This commit is contained in:
+37
-1
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: draw_tt.c,v 1.8 2001/04/29 23:13:34 steve Exp $"
|
||||
#ident "$Id: draw_tt.c,v 1.9 2001/06/19 03:01:10 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include <stdio.h>
|
||||
@@ -231,6 +231,38 @@ static void draw_MUXZ(void)
|
||||
printf("};\n");
|
||||
}
|
||||
|
||||
static void draw_EEQ(void)
|
||||
{
|
||||
unsigned i0, i1, i2, i3;
|
||||
|
||||
printf("const unsigned char ft_EEQ[64] = {");
|
||||
|
||||
for (i3 = 0 ; i3 < 4 ; i3 += 1)
|
||||
for (i2 = 0 ; i2 < 4 ; i2 += 1) {
|
||||
printf("\n ");
|
||||
for (i1 = 0 ; i1 < 4 ; i1 += 1) {
|
||||
unsigned idx = (i3 << 4) | (i2 << 2) | i1;
|
||||
unsigned char byte = 0;
|
||||
|
||||
for (i0 = 0 ; i0 < 4 ; i0 += 1) {
|
||||
unsigned val;
|
||||
if (i3 != i2)
|
||||
val = 0;
|
||||
else if (i1 != i0)
|
||||
val = 0;
|
||||
else
|
||||
val = 1;
|
||||
|
||||
byte |= val << (i0*2);
|
||||
}
|
||||
|
||||
printf("0x%02x, ", byte);
|
||||
}
|
||||
}
|
||||
|
||||
printf("};\n");
|
||||
}
|
||||
|
||||
static void draw_NOR(void)
|
||||
{
|
||||
unsigned i0, i1, i2, i3;
|
||||
@@ -500,6 +532,7 @@ main()
|
||||
draw_BUFIF0();
|
||||
draw_BUFIF1();
|
||||
draw_MUXZ();
|
||||
draw_EEQ();
|
||||
draw_NAND();
|
||||
draw_NOR();
|
||||
draw_NOT();
|
||||
@@ -513,6 +546,9 @@ main()
|
||||
|
||||
/*
|
||||
* $Log: draw_tt.c,v $
|
||||
* Revision 1.9 2001/06/19 03:01:10 steve
|
||||
* Add structural EEQ gates (Stephan Boettcher)
|
||||
*
|
||||
* Revision 1.8 2001/04/29 23:13:34 steve
|
||||
* Add bufif0 and bufif1 functors.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user