Hi all,of the PAL device) and a output enable (usually pin11 tied to GND)
I'm translating into Verilog some schematics.I have faced some PLDs (PAL or GAL),
Some have pure combinatorial logics which is easy to write in Verilog but other are registered so they need flip flops.I was wondering how to implement the latter.Here an example where you can see four outputs are registered so there is a clock (pin1
/** Inputs **/
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 12 = i12;
Pin 13 = i13;
Pin 14 = i14;
Pin 15 = i15;
Pin 16 = i16;
Pin 17 = i17;
Pin 18 = i18;
Pin 19 = i19;
/** Outputs **/
Pin 12 = o12; /**(Combinatorial, Output feedback output, Active low) **/ Pin 13 = o13; /**(Combinatorial, Output feedback output, Active low) **/ Pin 14 = o14; /**(Registered, Output feedback registered, Active low) **/ Pin 15 = o15; /**(Registered, Output feedback registered, Active low) **/ Pin 16 = o16; /**(Registered, Output feedback registered, Active low) **/ Pin 17 = o17; /**(Registered, Output feedback registered, Active low) **/ Pin 18 = o18; /**(Combinatorial, Output feedback output, Active low) **/ Pin 19 = o19; /**(Combinatorial, Output feedback output, Active low) **/
/** Equations **/
!o12 = o13;
o12.oe = vcc;
!o13 = o17 & o18
# o16 & !o18 & !o19;
o13.oe = vcc;
!o14 .d !i2
# i2 & !i4 & o14
# i2 & i4 & !o14;
o14.oe = OE;
!o15 .d !i2
# i2 & !i4 & !i5 & !o14 & o15
# i2 & !i4 & i5 & o14 & o15
# i2 & i4 & !i5 & o14 & o15
# i2 & i4 & !o14 & !o15
# i2 & i5 & !o14 & !o15
# i2 & !i4 & !i5 & o14 & !o15
# i2 & i4 & i5 & o14 & !o15;
o15.oe = OE;
!o16 .d !i2
# i2 & !i5 & o15 & o16
# i2 & !i4 & !i5 & o14 & o16
# i2 & i5 & !o16
# i2 & i4 & !o15 & !o16
# i2 & !o14 & !o15 & !o16;
o16.oe = OE;
!o17 .d !i2
# i2 & !i3 & i6 & o17
# i2 & !i3 & o17
# i2 & !i5 & i6 & o17 & !o19
# i2 & i3 & i5 & !o17
# i2 & i3 & !i6 & !o17
# i2 & i3 & !o17 & o19
# i2 & !i6 & !o17 & o19;
o17.oe = OE;
!o18 = i3 & o17
# !i3 & !o17 & o19;
!o19 = !i4 & o15 & o16
# !i4 & o14 & o16;
a 22V10 is in there:
<https://github.com/ezrec/galpal>
(good luck downloading anything from that site, tho')
Hi all,
I'm translating into Verilog some schematics.I have faced some PLDs (PAL
or GAL),
Some have pure combinatorial logics which is easy to write in Verilog
but other are registered so they need flip flops.I was wondering how to implement the latter.Here an example where you can see four outputs are registered so there is a clock (pin1 of the PAL device) and a output
enable (usually pin11 tied to GND)
/** Inputs **/
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 12 = i12;
Pin 13 = i13;
Pin 14 = i14;
Pin 15 = i15;
Pin 16 = i16;
Pin 17 = i17;
Pin 18 = i18;
Pin 19 = i19;
/** Outputs **/
Pin 12 = o12; /**(Combinatorial, Output feedback output, Active low) **/ Pin 13 = o13; /**(Combinatorial, Output feedback output, Active low) **/ Pin 14 = o14; /**(Registered, Output feedback registered, Active low) **/ Pin 15 = o15; /**(Registered, Output feedback registered, Active low) **/ Pin 16 = o16; /**(Registered, Output feedback registered, Active low) **/ Pin 17 = o17; /**(Registered, Output feedback registered, Active low) **/ Pin 18 = o18; /**(Combinatorial, Output feedback output, Active low) **/ Pin 19 = o19; /**(Combinatorial, Output feedback output, Active low) **/
/** Equations **/
!o12 = o13;
o12.oe = vcc;
!o13 = o17 & o18
# o16 & !o18 & !o19;
o13.oe = vcc;
!o14 .d !i2
# i2 & !i4 & o14
# i2 & i4 & !o14;
o14.oe = OE;
I would suggest declaring your combinatorials as 'wire' or as 'output' in
the module definition, and use 'assign' to specify the equation. Then
declare registered outputs as 'reg' or as 'output reg' in the module definition, and specify these inside an 'always' block.
example defining only o12 (combinatorial) and o14 (registered):
module pal (clk, i2, i4, o12, o13, o14);
input clk;
input i2;
input i4;
output o12;
output o13;
output reg o14;
assign o12 = ~o13;
always @(posedge clk)
begin
o14 <= ~i2 | (i2 & ~i4 & o14) | (i2 & i4 & ~o14);
end
Do you also need to implement the output enables?
On Wednesday, 18 August 2021 at 09:45:43 UTC+2, Johann Klammer wrote:
a 22V10 is in there:
<https://github.com/ezrec/galpal>
(good luck downloading anything from that site, tho')
Thanks for link.Actually I'm dealing with a PAL16R4 a,d GAL16V8, these devices are not included in the examples of the link .I'm also wondering if ispLEVER HDL modules produced after compilation of fusemap are enough to simulate such devices.
On 08/18/2021 06:58 PM, bri...@gmail.com wrote:
On Wednesday, 18 August 2021 at 09:45:43 UTC+2, Johann Klammer wrote:
a 22V10 is in there:
<https://github.com/ezrec/galpal>
(good luck downloading anything from that site, tho')
Thanks for link.Actually I'm dealing with a PAL16R4 a,d GAL16V8, these devices are not included in the examples of the link .I'm also wondering if ispLEVER HDL modules produced after compilation of fusemap are enough to simulate such devices.
old PLD dataheets usaully contain the fuse numbers and schematics, so a model is easy to write.
I tried to implement a fully combinatorial PAL and a partially registered one but they don't work on hardware.I can't figure out what is wrong, I asked a couple of my friend engineers and they told me they are correct.Here's the archive containing theextracted equations from the fusemaps and my Verilog implementations :
https://www.mediafire.com/file/nxiuuart6rdn1hw/PLD_Verilog.zip/file
I hope for help from someone more skilled than me (and my friends...).Thanks in advance.
On Friday, 20 August 2021 at 10:01:41 UTC+2, Johann Klammer wrote:
On 08/18/2021 06:58 PM, bri...@gmail.com wrote:
On Wednesday, 18 August 2021 at 09:45:43 UTC+2, Johann Klammerold PLD dataheets usaully contain the fuse numbers and schematics,
wrote:
a 22V10 is in there: <https://github.com/ezrec/galpal>
(good luck downloading anything from that site, tho')
Thanks for link.Actually I'm dealing with a PAL16R4 a,d GAL16V8,
these devices are not included in the examples of the link .I'm
also wondering if ispLEVER HDL modules produced after
compilation of fusemap are enough to simulate such devices.
so a model is easy to write.
I tried to implement a fully combinatorial PAL and a partially
registered one but they don't work on hardware.I can't figure out
what is wrong, I asked a couple of my friend engineers and they told
me they are correct.Here's the archive containing the extracted
equations from the fusemaps and my Verilog implementations :
https://www.mediafire.com/file/nxiuuart6rdn1hw/PLD_Verilog.zip/file
I hope for help from someone more skilled than me (and my
friends...).Thanks in advance.
On 09/11/2021 10:14 AM, bri...@gmail.com wrote:the extracted equations from the fusemaps and my Verilog implementations :
I tried to implement a fully combinatorial PAL and a partially registered one but they don't work on hardware.I can't figure out what is wrong, I asked a couple of my friend engineers and they told me they are correct.Here's the archive containing
https://www.mediafire.com/file/nxiuuart6rdn1hw/PLD_Verilog.zip/file
I hope for help from someone more skilled than me (and my friends...).Thanks in advance.
At least the 16R4 one looks ok. I do remember that some of those old softwares add flawed
inversions to the product terms. you may need some external inverters.
On 09/12/2021 09:46 AM, bri...@gmail.com wrote:the extracted equations from the fusemaps and my Verilog implementations :
On Saturday, 11 September 2021 at 21:44:55 UTC+2, Johann Klammer wrote:
On 09/11/2021 10:14 AM, bri...@gmail.com wrote:
I tried to implement a fully combinatorial PAL and a partially registered one but they don't work on hardware.I can't figure out what is wrong, I asked a couple of my friend engineers and they told me they are correct.Here's the archive containing
At least the 16R4 one looks ok. I do remember that some of those old softwares add flawed
https://www.mediafire.com/file/nxiuuart6rdn1hw/PLD_Verilog.zip/file
I hope for help from someone more skilled than me (and my friends...).Thanks in advance.
inversions to the product terms. you may need some external inverters.
Thanks for all your reply.I got the combinatorial PAL16L8 design working, the trick was to use the 'wire' variable since there is feedback of one output (pin 19).i aso applied some delay to outputs.This is the working code tested onto a small CPLD :
[...]
I think you've missed an o16 in the PAL16R4:
wire R13;
assign R13 = ~((reg_o17 & R18) |
(o16 & ~R18 & ~R19));
On Saturday, 11 September 2021 at 21:44:55 UTC+2, Johann Klammer wrote:the extracted equations from the fusemaps and my Verilog implementations :
On 09/11/2021 10:14 AM, bri...@gmail.com wrote:
I tried to implement a fully combinatorial PAL and a partially registered one but they don't work on hardware.I can't figure out what is wrong, I asked a couple of my friend engineers and they told me they are correct.Here's the archive containing
At least the 16R4 one looks ok. I do remember that some of those old softwares add flawed
https://www.mediafire.com/file/nxiuuart6rdn1hw/PLD_Verilog.zip/file
I hope for help from someone more skilled than me (and my friends...).Thanks in advance.
inversions to the product terms. you may need some external inverters.
Thanks for all your reply.I got the combinatorial PAL16L8 design working, the trick was to use the 'wire' variable since there is feedback of one output (pin 19).i aso applied some delay to outputs.This is the working code tested onto a small CPLD :
On Sunday, 12 September 2021 at 18:28:35 UTC+2, Johann Klammer wrote:the extracted equations from the fusemaps and my Verilog implementations : >>>>>
On 09/12/2021 09:46 AM, bri...@gmail.com wrote:
On Saturday, 11 September 2021 at 21:44:55 UTC+2, Johann Klammer wrote: >>>> On 09/11/2021 10:14 AM, bri...@gmail.com wrote:
I tried to implement a fully combinatorial PAL and a partially registered one but they don't work on hardware.I can't figure out what is wrong, I asked a couple of my friend engineers and they told me they are correct.Here's the archive containing
[...]https://www.mediafire.com/file/nxiuuart6rdn1hw/PLD_Verilog.zip/fileAt least the 16R4 one looks ok. I do remember that some of those old softwares add flawed
I hope for help from someone more skilled than me (and my friends...).Thanks in advance.
inversions to the product terms. you may need some external inverters.
Thanks for all your reply.I got the combinatorial PAL16L8 design working, the trick was to use the 'wire' variable since there is feedback of one output (pin 19).i aso applied some delay to outputs.This is the working code tested onto a small CPLD :
I think you've missed an o16 in the PAL16R4:
wire R13;
assign R13 = ~((reg_o17 & R18) |
(o16 & ~R18 & ~R19));
Yes, sorry, it should be :
wire R13;
assign R13 = ~((reg_o17 & R18) |
(reg_o16 & ~R18 & ~R19));
Anyway, it doesn't work the same.I've been told that the feedback output comes in inverted and non inverted form, a fiend of mine did this sheet from the PAL16R4 logics diagram but i can't understand it :
https://i.postimg.cc/15VSHhp9/3-Ca-nfo-C-jpg-medium.jpg
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 113 |
Nodes: | 8 (1 / 7) |
Uptime: | 27:12:12 |
Calls: | 2,498 |
Files: | 8,649 |
Messages: | 1,905,707 |