diff --git a/regtests/jedutil/baseline/gal16v8/gal16v8_simple_mode_2.txt b/regtests/jedutil/baseline/gal16v8/gal16v8_simple_mode_2.txt new file mode 100644 index 00000000000..68cb5d26f29 --- /dev/null +++ b/regtests/jedutil/baseline/gal16v8/gal16v8_simple_mode_2.txt @@ -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 + diff --git a/regtests/jedutil/eqns/WinCUPL/gal16v8/gal16v8_simple_mode_2.pld b/regtests/jedutil/eqns/WinCUPL/gal16v8/gal16v8_simple_mode_2.pld new file mode 100644 index 00000000000..1908328cc28 --- /dev/null +++ b/regtests/jedutil/eqns/WinCUPL/gal16v8/gal16v8_simple_mode_2.pld @@ -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 ; diff --git a/regtests/jedutil/jeds/gal16v8/gal16v8_simple_mode_2.jed b/regtests/jedutil/jeds/gal16v8/gal16v8_simple_mode_2.jed new file mode 100644 index 00000000000..e851793a1b7 --- /dev/null +++ b/regtests/jedutil/jeds/gal16v8/gal16v8_simple_mode_2.jed @@ -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 \ No newline at end of file diff --git a/src/tools/jedutil.cpp b/src/tools/jedutil.cpp index a4ea6b57cfb..73e190e3f0e 100644 --- a/src/tools/jedutil.cpp +++ b/src/tools/jedutil.cpp @@ -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; }