Bug fix for when viewing the logic equations of the GAL16V8 device with jedutil (#9315)

* Fixed the viewing of a GAL16V8 device when in simple mode and pins 15 or 16 have no product terms.
This commit is contained in:
Kevin Eshbach 2022-02-18 22:38:44 -05:00 committed by GitHub
parent 8541608e12
commit 1bbf1261ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 128 additions and 23 deletions

View File

@ -0,0 +1,25 @@
Inputs:
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 17, 18, 19
Outputs:
12 (Combinatorial, Output feedback output, Active low)
15 (Combinatorial, No output feedback, Active low)
16 (Combinatorial, No output feedback, Active low)
Equations:
/o12 = i1 +
i2 +
i3 +
/i4 +
/i5
o12.oe = vcc
/o15 =
o15.oe = vcc
/o16 =
o16.oe = vcc

View File

@ -0,0 +1,41 @@
Name GAL16V8 Simple Mode Test 2 ;
PartNo 00 ;
Date 2/16/2022 ;
Revision 01 ;
Designer MAME ;
Company MAME ;
Assembly None ;
Location ;
Device G16V8A ;
/* Simple Mode Test 2 */
/* Input Pins */
PIN 1 = [I1] ;
PIN 2 = [I2] ;
PIN 3 = [I3] ;
PIN 4 = [I4] ;
PIN 5 = [I5] ;
PIN 6 = [I6] ;
PIN 7 = [I7] ;
PIN 8 = [I8] ;
PIN 9 = [I9] ;
PIN 11 = [I11] ;
/* Output Pins */
PINNODE 12 = [O12] ;
PINNODE 13 = [O13] ;
PINNODE 14 = [O14] ;
PINNODE 15 = [O15] ;
PINNODE 16 = [O16] ;
PINNODE 17 = [O17] ;
PINNODE 18 = [O18] ;
PINNODE 19 = [O19] ;
/* Logic Equations */
!O12 = I1 #
I2 #
I3 #
!I4 #
!I5 ;

View File

@ -0,0 +1,27 @@

CUPL(WM) 5.0a Serial# 60008009
Device g16v8as Library DLIB-h-40-2
Created Wed Feb 16 21:22:13 2022
Name GAL16V8 Simple Mode Test 2
Partno 00
Revision 01
Date 2/16/2022
Designer MAME
Company MAME
Assembly None
Location
*QP20
*QF2194
*G0
*F0
*L01792 11011111111111111111111111111111
*L01824 01111111111111111111111111111111
*L01856 11110111111111111111111111111111
*L01888 11111111101111111111111111111111
*L01920 11111111111110111111111111111111
*L02048 00000000001100000011000000100000
*L02112 00000000111111101111111111111111
*L02144 11111111111111111111111111111111
*L02176 111111111111111110
*C1C49
*9652

View File

@ -5270,22 +5270,46 @@ static void config_gal16v8_pins(const pal_data* pal, const jed_data* jed)
for (index = 0; index < std::size(macrocells); ++index)
{
if (jed_get_fuse(jed, macrocells[index].ac1_fuse))
if (macrocells[index].pin != 15 && macrocells[index].pin != 16)
{
/* Pin is for input only */
input_pins_combinatorialsimple[input_pin_count] = macrocells[index].pin;
++input_pin_count;
if (macrocells[index].pin == 15 || macrocells[index].pin == 16)
if (jed_get_fuse(jed, macrocells[index].ac1_fuse))
{
fprintf(stderr, "Pin %d cannot be configured as an input pin.\n",
macrocells[index].pin);
/* Pin is for input only */
input_pins_combinatorialsimple[input_pin_count] = macrocells[index].pin;
++input_pin_count;
}
else
{
output_pins[output_pin_count].pin = macrocells[index].pin;
output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL;
if (jed_get_fuse(jed, macrocells[index].xor_fuse))
{
output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
}
else
{
output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
}
output_pins[output_pin_count].flags |= OUTPUT_FEEDBACK_OUTPUT;
input_pins_combinatorialsimple[input_pin_count] = macrocells[index].pin;
++input_pin_count;
++output_pin_count;
}
}
else
{
/* For pins 15 and 16 ignore the value of the ac1_fuse (This
normally determine if the pin is an input or output.) because
according to the datasheet these macrocells are output
only when in simple mode. */
output_pins[output_pin_count].pin = macrocells[index].pin;
output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL;
@ -5298,19 +5322,7 @@ static void config_gal16v8_pins(const pal_data* pal, const jed_data* jed)
output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
}
if (output_pins[output_pin_count].pin != 15 &&
output_pins[output_pin_count].pin != 16)
{
output_pins[output_pin_count].flags |= OUTPUT_FEEDBACK_OUTPUT;
input_pins_combinatorialsimple[input_pin_count] = macrocells[index].pin;
++input_pin_count;
}
else
{
output_pins[output_pin_count].flags |= OUTPUT_FEEDBACK_NONE;
}
output_pins[output_pin_count].flags |= OUTPUT_FEEDBACK_NONE;
++output_pin_count;
}