I'm trying to convert some CPLD code from Abel into VHDL.
I have the below lines and I'm trying wrap my head around it. I've never used Abel, but I'm familiar with C for programming micros.
Inputs and outputs I can understand, the only thing I'm not clear with is the istype. I could not find an 'input' attribute on Lattice's Abel reference manual and was wondering if anyone here has any idea what it is.
for istype 'com'; the reference manual mentions that 'com' is a Combinational output, what does this really mean? Does it just mean that it is an output result of combination of inputs?
Are nodes simply wires that can be attached to pins and other input declarations?
The declaration of D0-D7 is of 'istype 'reg_d. Seems like a flip-flop declaration for each node.
XEN looks simply like an 8-bit register.
What I don't understand are the bottom three lines of the equation:
OUT.CLK = SPI0_SCLK;
XEN.D = OUT.Q;
XEN.CLK = SPI0_CS3;[/CODE]
Other then setting up the pins on VHDL i'm stuck at the equations section.
I have the below lines and I'm trying wrap my head around it. I've never used Abel, but I'm familiar with C for programming micros.
Inputs and outputs I can understand, the only thing I'm not clear with is the istype. I could not find an 'input' attribute on Lattice's Abel reference manual and was wondering if anyone here has any idea what it is.
for istype 'com'; the reference manual mentions that 'com' is a Combinational output, what does this really mean? Does it just mean that it is an output result of combination of inputs?
Are nodes simply wires that can be attached to pins and other input declarations?
The declaration of D0-D7 is of 'istype 'reg_d. Seems like a flip-flop declaration for each node.
XEN looks simply like an 8-bit register.
What I don't understand are the bottom three lines of the equation:
OUT.CLK = SPI0_SCLK;
XEN.D = OUT.Q;
XEN.CLK = SPI0_CS3;[/CODE]
Other then setting up the pins on VHDL i'm stuck at the equations section.
Code:
//inputs
SPI0_CS3 Pin 92 istype 'input';
// outputs
SPI0_MISO Pin 66 istype 'com';
//Nodes
D0,D1,D2,D3,D4,D5,D6,D7 Node istype 'reg_d';
XEN = [Data0,Data1,Data2,Data3,Data4,Data5,Data6,Data7];
OUT = [D7..D0];
equations
D0.D = (!SPI0_CS3 & SPI0_MOSI) # (SPI0_CS3 & D0.Q);
D1.D = (!SPI0_CS3 & D0.Q) # (SPI0_CS3 & D1.Q);
D2.D = (!SPI0_CS3 & D1.Q) # (SPI0_CS3 & D2.Q);
D3.D = (!SPI0_CS3 & D2.Q) # (SPI0_CS3 & D3.Q);
D4.D = (!SPI0_CS3 & D3.Q) # (SPI0_CS3 & D4.Q);
D5.D = (!SPI0_CS3 & D4.Q) # (SPI0_CS3 & D5.Q);
D6.D = (!SPI0_CS3 & D5.Q) # (SPI0_CS3 & D6.Q);
D7.D = (!SPI0_CS3 & D6.Q) # (SPI0_CS3 & D7.Q);
OUT.CLK = SPI0_SCLK;
XEN.D = OUT.Q;
XEN.CLK = SPI0_CS3;
Last edited: