WinCUPL question(s)

Topics relating to PALs, CPLDs, FPGAs, and other PLDs used for the support or creation of 65-family processors, both hardware and HDL.
Post Reply
Jokse
Posts: 15
Joined: 29 Nov 2013
Location: Denmark

WinCUPL question(s)

Post by Jokse »

I'm doing a FIELD in WinCUPL for a 22V10, but as soon as I want to use the .d flip flop part for synchronizing with a master clock on pin one, using something like out.d = input:[0..2FF] doesn't work... Do I really have to spell out the full logic equation or is there some way to get around that?

Code: Select all

Name Test;
PartNo 01;
Date 04-04-2018;
Revision 01;
Designer Flaf;
Company Flaf;
Assembly Flaf;
Location Flaf;
Device p22v10;

PIN 1 = clk;
PIN [2,3,4,5,6,7,8,9,10,11] = [in0..9];
PIN 22 = output;
FIELD input = [in9..0];
output.ar = 'b'0;
output.sp = 'b'0;
output.d = input:[0..2FF];

Code: Select all

  17:output.d = input:[0..2FF];
                           ^
[002ca] invalid number: 2FF
[002ca] invalid number: 2FF
[002ca] invalid number: 2FF
Total time: 0 secs 
Martin A
Posts: 197
Joined: 02 Jan 2016

Re: WinCUPL question(s)

Post by Martin A »

It would appear to work if you use 'h'2ff instead of just 2ff. Not sure why the explicit hex definition is needed though.
Jokse
Posts: 15
Joined: 29 Nov 2013
Location: Denmark

Re: WinCUPL question(s)

Post by Jokse »

Martin A wrote:
It would appear to work if you use 'h'2ff instead of just 2ff. Not sure why the explicit hex definition is needed though.
That certainly did the trick! Thanks!
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: WinCUPL question(s)

Post by BigDumbDinosaur »

Martin A wrote:
It would appear to work if you use 'h'2ff instead of just 2ff. Not sure why the explicit hex definition is needed though.
The hex reference is required because decimal is the default in CUPL. Without the 'h' prefix, the compiler might try to evaulate the 2ff part as a variable.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Martin A
Posts: 197
Joined: 02 Jan 2016

Re: WinCUPL question(s)

Post by Martin A »

I always thought hex was the default, the following code from one of my projects compiles correctly without any explicit 'h' declarations.

Code: Select all

Name     AtomGAL ;
PartNo   00 ;
Date     09/02/2018 ;
Revision 01 ;
Designer Engineer ;
Company  None ;
Assembly None ;
Location  ;
Device   p22v10 ;

/* *************** INPUT PINS *********************/
PIN   1  = A12                      ; /*                                 */ 
PIN   2  = A13                      ; /*                                 */ 
PIN   3  = A14                      ; /*                                 */ 
PIN   4  = A15                      ; /*                                 */ 
PIN   5  = A11                      ; /*                                 */ 
PIN   6  = A10                      ; /*                                 */ 
PIN   7  = A9                       ; /*                                 */ 
PIN   8  = rw                       ; /*                                 */ 
PIN   9  = phi2                     ; /*                                 */ 



/* *************** OUTPUT PINS *********************/
PIN  14   = wr                      ; /*                                 */ 
PIN  15   = rd                      ; /*                                 */ 
PIN  16   = ma2                     ; /*                                 */ 
PIN  17   = vram                    ; /*                                 */ 
PIN  18   = io6                     ; /*                                 */ 
PIN  19   = io4                     ; /*                                 */ 
PIN  20   = io2                     ; /*                                 */ 
PIN  21   = io0                     ; /*                                 */ 
PIN  22   = ramcs                   ; /*                                 */ 
PIN  23   = romcs                   ; /*                                 */ 


Field address = [A15..0];

!ramcs = address:[0000..7FFF] ;

!io0 =address:[B000..B3FF] ;

!io2 =address:[B400..B7FF] ;

!io4 =address:[B800..BBFF] ;

!io6 =address:[BC00..BFFF] ;

!romcs = address:[C000..FFFF] ;

!vram = address:[8000..97FF] ;

!ma2 = address:[A000..AFFF] ;

!rd =  rw & phi2  ;

!wr = !rw & phi2  ;

Tor
Posts: 597
Joined: 10 Apr 2011
Location: Norway/Japan

Re: WinCUPL question(s)

Post by Tor »

Maybe WinCUPL will understand [02FF] as hex, but not [2FF] (without the 'h')?
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: WinCUPL question(s)

Post by BigEd »

Maybe a 10 bit number, not being an even number of nibbles, throws it.

Is it worth padding the zero to make the numbers the same length?

Code: Select all

output.d = input:[000..2FF];
User avatar
cbscpe
Posts: 491
Joined: 13 Oct 2013
Location: Switzerland
Contact:

Re: WinCUPL question(s)

Post by cbscpe »

The default is hex. But it is overwritten when using a prefix, like in your case you say

Code: Select all

output.ar = ´b´0
after that the default is binary.
Post Reply