6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 6:30 pm

All times are UTC




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed May 25, 2022 2:53 pm 
Offline
User avatar

Joined: Tue Apr 03, 2018 2:10 pm
Posts: 125
I've decided it's time to try to get my head around CPLDs, and it's not going well.

I wrote my first code, using WinCUPL on a Win10 machine. And while it compiles (for an ATF1502) without errors or warnings, it doesn't create .jed or .fit files. I'll put the code below for reference. I'm sure there are all manner of things wrong with it.

I've tried some of the advice (including the scripts) in this thread: viewtopic.php?t=6782

So far, no luck.

Am I missing something? Seems likely...

Code:
Name     DECODE ;
PartNo   00 ;
Date     25/05/2022 ;
Revision 01 ;
Designer SMD ;
Company  Machina Speculatrix ;
Assembly None ;
Location  ;
Device   f1502tqfp44 ;

/* *************** INPUT PINS *********************/


PIN    = CLK            ; /* PHI2 clock                      */
PIN    = RW             ; /* R/W                             */
PIN  = [A15..8]         ; /* Address pins to select I/O      */
PIN    = ASEV           ; /* Address pins to select I/O devs */
PIN    = ASIX           ; /* "                               */
PIN    = AFIV           ; /* "                               */

/* *************** OUTPUT PINS *********************/
PIN  = [IO7..0]         ; /*                                 */
PIN   = RD_EN           ; /*                                 */
PIN   = WR_EN           ; /*                                 */
PIN   = ROM_EN          ; /*                                 */
PIN   = RAM_EN          ; /*                                 */


!RAM_EN = !A15 ;
!ROM_EN = A15 & A14 ;
!WR_EN = CLK & !RW ;
!RD_EN = CLK & RW ;


/* IO_EN = A15 & !A14 & A13 & A12 & A11 & A10 & A9 & A8 & CLK; */
IO_EN = A15 & !A14 & [A13..8]:& & CLK;


FIELD DEV_ADDR = [IO_EN, ASEV, ASIX, AFIV];
FIELD DEV_SELECT = [IO7..0];

TABLE DEV_ADDR => DEV_SELECT {
'b'0XXX => 'b'11111111 ;
'b'1000 => 'b'11111110 ;
'b'1001 => 'b'11111101 ;
'b'1010 => 'b'11111011 ;
'b'1011 => 'b'11110111 ;
'b'1100 => 'b'11101111 ;
'b'1101 => 'b'11011111 ;
'b'1110 => 'b'10111111 ;
'b'1111 => 'b'01111111 ;
}

_________________
I like it when things smoke.
BlogZolatron 64 project


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2022 3:00 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
Maybe worth looking at
viewtopic.php?f=10&t=7122

I think many people have been around this loop, and I think always the right combination of careful syntax and careful use of features has saved the day. But I don't know of any central record of all the best advice.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2022 3:09 pm 
Offline
User avatar

Joined: Tue Apr 03, 2018 2:10 pm
Posts: 125
I should probably have mentioned that the compiler is outputting .abs, .doc, .lst, .pdf, .pla, .sim and .tt2 files just fine.

_________________
I like it when things smoke.
BlogZolatron 64 project


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2022 3:13 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
That sounds encouraging. Does the lst file show that the source has been fully and correctly interpreted?

What documentation are you working from?


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2022 3:29 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Are the files you're compiling in the current directory? WinCUPL doesn't work properly if they're not. The script I use copies my source file to a target directory first, then compiles it there with it set to be the current directory, to get around this while still keeping the target files separate from the source files. My script also invokes the simulator if you provided a .si file, and collates the errors better than the default - there are a lot of things you can do to improve the experience a bit from the low bar that WinCUPL's own GUI sets!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2022 3:32 pm 
Offline
User avatar

Joined: Tue Apr 03, 2018 2:10 pm
Posts: 125
As far as I can see, the .lst file just contains my original code. I’m using an Atmel manual for reference (don’t have it to hand at the moment).

_________________
I like it when things smoke.
BlogZolatron 64 project


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2022 3:36 pm 
Offline
User avatar

Joined: Tue Apr 03, 2018 2:10 pm
Posts: 125
I need to edit and play around with the scripts a bit more.

BTW, I can tell that Wincupl invoked fit1502.exe and find1502.exe at some point because Kaspersky whitelisted them.

_________________
I like it when things smoke.
BlogZolatron 64 project


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2022 7:30 pm 
Offline
User avatar

Joined: Tue Apr 03, 2018 2:10 pm
Posts: 125
Okay, I've now had a chance to mess with the scripts - getting paths etc sorted. And it worked!

I had to guess what the device code should be in find1502. I'm using the TQFP device (f1502tqfp44). I tried -dev P1502P44 (as a guess) but that didn't work and it reverted to PLCC. So I tried P1502T44 - that didn't throw any complaints, so I'm guessing that worked.

BTW, in the ccupl.cmd script I had to use full paths for everything. I've set the PATH and LIBCUPL environment vars, but that didn't help.

_________________
I like it when things smoke.
BlogZolatron 64 project


Top
 Profile  
Reply with quote  
PostPosted: Wed May 25, 2022 8:00 pm 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
Just to be thorough, have you verified that the JEDEC option is still selected in the Compiler Options - Output Files tab.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 26, 2022 6:34 am 
Offline
User avatar

Joined: Tue Apr 03, 2018 2:10 pm
Posts: 125
tmr4 wrote:
Just to be thorough, have you verified that the JEDEC option is still selected in the Compiler Options - Output Files tab.


I did indeed. Even tried turning it off and on again.

_________________
I like it when things smoke.
BlogZolatron 64 project


Top
 Profile  
Reply with quote  
PostPosted: Thu May 26, 2022 3:50 pm 
Offline
User avatar

Joined: Tue Apr 03, 2018 2:10 pm
Posts: 125
Yay! Final update. I wrote the Jedec file to a chip, connected my test rig and it worked as expected (although the code has changed a little from that above). Of course, it’s now not working again, but I think that’s a hardware gremlin in my test rig.

_________________
I like it when things smoke.
BlogZolatron 64 project


Top
 Profile  
Reply with quote  
PostPosted: Mon May 30, 2022 10:22 am 
Offline
User avatar

Joined: Tue Apr 03, 2018 2:10 pm
Posts: 125
Just a final question - I've managed to dispense with the awful WinCUPL thanks to a hacked version of gfoot's script. But I'm still using the ATMISP GUI program for writing to the CPLD. Is there any command line alternative to this? I'd like to be able to automate compile, erase & burn with a single script.

_________________
I like it when things smoke.
BlogZolatron 64 project


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 04, 2023 7:04 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
Thanks to all who pitched in here. I was having the exact same problem, and lo and behold, my friends on the 6502 forum have the answers!

I want to list out what I am doing, what issues I was having, and then exactly how I fixed them. First, a link:

https://mike42.me/blog/2021-08-a-first- ... able-logic

That helped me get started.

I'm running Linux Mint, and I downloaded WinCUPL from the Microchip website:

https://www.microchip.com/en-us/product ... -resources

I went through Mike's tutorial, using 'wine' and 'winetricks'. I had the exact same 339 error like he had, and his commands on the tutorial fixed it for me too.

Once I got WinCUPL installed and running, I made a little test program, but just like speculatrix I wasn't getting a .jed file at all. I tried what Mike had said in his tutorial without any luck.

After reading through here about paths and what not, I realized that the Options -> Devices was not actually DOING anything to my code. Instead, it's just a handy database for you to copy-paste the Device Mnemonic into your code under "Device" on the header portion. Once I did that, everything worked beautifully!

Well, beautifully is relative I suppose. My main WinCUPL folder exploded with a ton of junk files now. I see George (gfoot) has made a script to fix all that, and I will either make my own or look into his soon.

In the end, I got the .jed file, and that's what counts. Thanks for this post!

Chad


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 04, 2023 11:13 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1076
Location: Albuquerque NM USA
Chad,
Are you getting into programmable logic? SPLD like 22V10 or CPLD like ATF150x?
Bill


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 05, 2023 2:49 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 703
Location: Texas
plasmo wrote:
Chad,
Are you getting into programmable logic? SPLD like 22V10 or CPLD like ATF150x?
Bill


Trying to at least! I'm a very picky person, and I want to run everything in Linux (using 'wine' is acceptable) if at all possible. I'm finding that the biggest hurdle here. Thankfully WinCUPL actually does work in wine, so I'm good there. The second thing I'm picky about is using current-production parts, so yes the ATF150x chips are kind of my target for now. The 22V10's are not what I am going for, as I do not think they would so *greatly* enhance my current projects that it would be worth my time looking into them. I could be wrong though!

It's a new journey into the unknown! Thank you Bill.

Chad


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: