ATF1504AS: Questions about this CPLD
ATF1504AS: Questions about this CPLD
I hope to start messing with my new CPLD setup over the holidays.
I've tinkered around with FPGA in the past...even though it was a gigantic pain to get everything setup. I'm hoping my CPLD experience won't be as bad.
So, I have the ATF1504AS and the official Altera USB cable. I also have a PLCC-44 to DIP 44 converter.
1) What language are you guys using to program these CPLD's? I've seen WinCUPL mentioned (I'm assuming CUPL is the language).
2) This CPLD will be used for glue logic but I'd like to learn a "hello world" with it by flashing some LED's. Are there any tutorials out there for something like that? I have actually searched online but *EVERYTHING* I find is centered around VHDL/Verilog and FPGA. Perhaps my search skills are failing me.
3) 64 macrocells doesn't sound like it can do much. But I admit, I'm still not 100% sure what a macrocell actually is. How many macrocells do you guys think would be needed for a BASIC VGA controller? Nothing fancy...just driving some pixels from SRAM. I'm planning for a future project where I will either use a larger CPLD or a small FPGA.
Thanks!
I've tinkered around with FPGA in the past...even though it was a gigantic pain to get everything setup. I'm hoping my CPLD experience won't be as bad.
So, I have the ATF1504AS and the official Altera USB cable. I also have a PLCC-44 to DIP 44 converter.
1) What language are you guys using to program these CPLD's? I've seen WinCUPL mentioned (I'm assuming CUPL is the language).
2) This CPLD will be used for glue logic but I'd like to learn a "hello world" with it by flashing some LED's. Are there any tutorials out there for something like that? I have actually searched online but *EVERYTHING* I find is centered around VHDL/Verilog and FPGA. Perhaps my search skills are failing me.
3) 64 macrocells doesn't sound like it can do much. But I admit, I'm still not 100% sure what a macrocell actually is. How many macrocells do you guys think would be needed for a BASIC VGA controller? Nothing fancy...just driving some pixels from SRAM. I'm planning for a future project where I will either use a larger CPLD or a small FPGA.
Thanks!
Cat; the other white meat.
Re: ATF1504AS: Questions about this CPLD
There is some useful information in the ATF15xxx family overview, including a picture of their macrocell.
Each output pin requires a macrocell to drive it. In addition, each internal bit of state (i.e. a flip/flop) requires another macrocell. Another limitation is the 5 product terms per macrocell. If you need more, then neighbouring macrocells will be used to provide more product terms.
To see if a particular device is suitable, I recommend downloading the design tools first, design your project, and run the synthesis to see what device it will fit. Usually the tools will inform you about number of macrocells used for what purpose, allowing you to try to improve the design to make it fit better. Personally, I always use verilog for CPLD design, but that's a personal preference.
Each output pin requires a macrocell to drive it. In addition, each internal bit of state (i.e. a flip/flop) requires another macrocell. Another limitation is the 5 product terms per macrocell. If you need more, then neighbouring macrocells will be used to provide more product terms.
To see if a particular device is suitable, I recommend downloading the design tools first, design your project, and run the synthesis to see what device it will fit. Usually the tools will inform you about number of macrocells used for what purpose, allowing you to try to improve the design to make it fit better. Personally, I always use verilog for CPLD design, but that's a personal preference.
Re: ATF1504AS: Questions about this CPLD
Thanks for the information. I actually have been reading the datasheet for that part. But, it's written (IMHO) for people who already have a good understanding of CPLD's and PLD's in general.
I've programmed (a little) with VHDL and thought it was OK. The Verilog I've seen looks more "C-like" which is nice considering I'm a C/C++/Java developer. So, I have no issues with learning Verilog.
It also sounds like my assumptions are true...there just isn't much you can do with 64 macrocells. But, that's OK because I didn't buy the ATF1504AS for VGA work. I'm sure it can handle some complex glue logic (I intend to map some of the Apple IIe memory maps for 128K).
I've programmed (a little) with VHDL and thought it was OK. The Verilog I've seen looks more "C-like" which is nice considering I'm a C/C++/Java developer. So, I have no issues with learning Verilog.
It also sounds like my assumptions are true...there just isn't much you can do with 64 macrocells. But, that's OK because I didn't buy the ATF1504AS for VGA work. I'm sure it can handle some complex glue logic (I intend to map some of the Apple IIe memory maps for 128K).
Cat; the other white meat.
Re: ATF1504AS: Questions about this CPLD
I agree, the Atmel datasheet isn't very good at explaining the details. I've been more impressed with Xilinx CPLD datasheets. Even though those are not the devices you intend to use, the general principles are very similar, so they may still be helpful in understanding.
Also, if you have the design tools, you could start with some very simple stuff, like blinking LEDs and doing simple logic functions, and then look at how things were implemented.
Also, if you have the design tools, you could start with some very simple stuff, like blinking LEDs and doing simple logic functions, and then look at how things were implemented.
Re: ATF1504AS: Questions about this CPLD
Arlet wrote:
Also, if you have the design tools, you could start with some very simple stuff, like blinking LEDs and doing simple logic functions, and then look at how things were implemented.
What tools do you suggest?
Cat; the other white meat.
Re: ATF1504AS: Questions about this CPLD
You'll need tools from Atmel, since these are the only ones that know how to synthesize for their devices. From their site, it looks like you have a choice between WinCUPL, and ProChip Designer. Only the ProChip Designer can do VHDL/Verilog, and it requires a license. Not sure if you can get a free license or if it's all paid.
Re: ATF1504AS: Questions about this CPLD
Ugh...this is what I hated about the FPGA software. Took an Act of Congress to get a license to install the 30 GIGS of software. :-/
But thanks for the suggestions!
But thanks for the suggestions!
Cat; the other white meat.
Re: ATF1504AS: Questions about this CPLD
The tools from Xilinx also require a few gigs of software, but at least their license is free for all small devices.
Re: ATF1504AS: Questions about this CPLD
cbmeeks wrote:
I hope to start messing with my new CPLD setup over the holidays.
I've tinkered around with FPGA in the past...even though it was a gigantic pain to get everything setup. I'm hoping my CPLD experience won't be as bad.
So, I have the ATF1504AS and the official Altera USB cable. I also have a PLCC-44 to DIP 44 converter.
1) What language are you guys using to program these CPLD's? I've seen WinCUPL mentioned (I'm assuming CUPL is the language).
2) This CPLD will be used for glue logic but I'd like to learn a "hello world" with it by flashing some LED's. Are there any tutorials out there for something like that? I have actually searched online but *EVERYTHING* I find is centered around VHDL/Verilog and FPGA. Perhaps my search skills are failing me.
3) 64 macrocells doesn't sound like it can do much. But I admit, I'm still not 100% sure what a macrocell actually is. How many macrocells do you guys think would be needed for a BASIC VGA controller? Nothing fancy...just driving some pixels from SRAM. I'm planning for a future project where I will either use a larger CPLD or a small FPGA.
Thanks!
I've tinkered around with FPGA in the past...even though it was a gigantic pain to get everything setup. I'm hoping my CPLD experience won't be as bad.
So, I have the ATF1504AS and the official Altera USB cable. I also have a PLCC-44 to DIP 44 converter.
1) What language are you guys using to program these CPLD's? I've seen WinCUPL mentioned (I'm assuming CUPL is the language).
2) This CPLD will be used for glue logic but I'd like to learn a "hello world" with it by flashing some LED's. Are there any tutorials out there for something like that? I have actually searched online but *EVERYTHING* I find is centered around VHDL/Verilog and FPGA. Perhaps my search skills are failing me.
3) 64 macrocells doesn't sound like it can do much. But I admit, I'm still not 100% sure what a macrocell actually is. How many macrocells do you guys think would be needed for a BASIC VGA controller? Nothing fancy...just driving some pixels from SRAM. I'm planning for a future project where I will either use a larger CPLD or a small FPGA.
Thanks!
All of my ABEL code is on my website if you want some examples.
http://sbc.rictor.org/decoder.html
http://sbc.rictor.org/wsgen.html
http://sbc.rictor.org/download/sbc3.zip
Cheers!
Daryl
Please visit my website -> https://sbc.rictor.org/
Re: ATF1504AS: Questions about this CPLD
8BIT wrote:
WinCUPL's language is ABEL. Although its not as main stream as VHDL/verilog, It is not hard to learn. I programmed my DEC-1 and wait-state generator (22V10 GAL), SBC-3, and SBC-4's CPLD's using ABEL. The SBC-3's CPLD has 108 macrocells and generated a 320x200 display with 8 bits per pixel using the PHI2 lo half-cycle and did the system memory buffering/decoding.
All of my ABEL code is on my website if you want some examples.
http://sbc.rictor.org/decoder.html
http://sbc.rictor.org/wsgen.html
http://sbc.rictor.org/download/sbc3.zip
Cheers!
Daryl
All of my ABEL code is on my website if you want some examples.
http://sbc.rictor.org/decoder.html
http://sbc.rictor.org/wsgen.html
http://sbc.rictor.org/download/sbc3.zip
Cheers!
Daryl
Oh, do you remember how many of those 108 macrocells was used for the SBC3?
Cat; the other white meat.
Re: ATF1504AS: Questions about this CPLD
107 or 108. I kept adding features until I ran out of room.
Daryl
Daryl
Please visit my website -> https://sbc.rictor.org/
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: ATF1504AS: Questions about this CPLD
cbmeeks wrote:
1) What language are you guys using to program these CPLD's? I've seen WinCUPL mentioned (I'm assuming CUPL is the language).
Quote:
2) This CPLD will be used for glue logic but I'd like to learn a "hello world" with it by flashing some LED's. Are there any tutorials out there for something like that? I have actually searched online but *EVERYTHING* I find is centered around VHDL/Verilog and FPGA. Perhaps my search skills are failing me.
Quote:
3) 64 macrocells doesn't sound like it can do much. But I admit, I'm still not 100% sure what a macrocell actually is. How many macrocells do you guys think would be needed for a BASIC VGA controller? Nothing fancy...just driving some pixels from SRAM. I'm planning for a future project where I will either use a larger CPLD or a small FPGA.
Note that the ATF1504AS has 32 uncommitted I/O pins. It is possible to use the JTAG pins as I/Os, but doing so will make it impossible to reprogram the device with the Atmel or Altera programmer. Also note that the 1504 has an assigned clock input (GCLK1, on pin 43) and assigned reset input (GCLR, on pin 1). These two should be permanently assigned in your CUPL source file, with statements such as the following:
Code: Select all
pin 1 = RESB; /* system reset */
pin 43 = PHI2; /* system clock */In addition to the PIN assignment statement, there is also the PINNODE statement, which doesn't use a pin number. PINNODE is how you set up buried logic, e.g., flip-flops. For example:
Code: Select all
pinnode = [blatch0..3]; /* bank address latches */Code: Select all
/*
========================
A16-A19 GENERATION LOGIC
========================
*/
[blatch0..3].LE = bavalid; /* open latches */
[blatch0..3].L = bavalid & [D0..3]; /* capture bank */
bank0 = [blatch0..3]:'b'0000; /* 1 if bank is $00 */
extram = !bank0; /* 1 if bank is not $00 */At the beginning of your source file, you can insert some statements that affect how WinCUPL processes your logic and fits your design to the device:
Code: Select all
property atmel {cascade_logic=on};
property atmel {logic_doubling=off};
property atmel {output_fast=off};
property atmel {pin_keep=on};
property atmel {preassign=keep};
property atmel {security=off};
property atmel {xor_synthesis=on};Your general workflow in WinCUPL is to create a project, write your CUPL code (CUPL means "compiled universal programming language") with the built-in editor, compile, fix any compilation errors, and then simulate your design. Within the simulator, you can set inputs, run the simulation and see how the outputs are affected. Once you are satisfied with your design you can run the Atmel ISP program to program your CPLD.
If you do a search here you should be able to find other posts about this stuff.
- Attachments
-
- cupl_reference.pdf
- WinCUPL Reference
- (814.53 KiB) Downloaded 373 times
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: ATF1504AS: Questions about this CPLD
@BDD
Thanks for that information! I have a lot of reading to do.
That's a good point about the JTAG and clk/reset pins. So, since I want to be able to program in-circuit, I actually need to subtract 6 pins for JTAG and 2 for clk/reset. Does that mean I only have 24 I/O pins? If so, that's going to suck.
Thanks for that information! I have a lot of reading to do.
That's a good point about the JTAG and clk/reset pins. So, since I want to be able to program in-circuit, I actually need to subtract 6 pins for JTAG and 2 for clk/reset. Does that mean I only have 24 I/O pins? If so, that's going to suck.
Cat; the other white meat.
Re: ATF1504AS: Questions about this CPLD
cbmeeks wrote:
Does that mean I only have 24 I/O pins? If so, that's going to suck. 
Re: ATF1504AS: Questions about this CPLD
I think it is 4 pins for the JTAG.
My quick pin count for the 1504 is
4 for Vcc
4 grounds
4 JTAG
4 input only
and up to 28 I/O
My quick pin count for the 1504 is
4 for Vcc
4 grounds
4 JTAG
4 input only
and up to 28 I/O