Topics relating to PALs, CPLDs, FPGAs, and other PLDs used for the support or creation of 65-family processors, both hardware and HDL.
Jokse
Posts: 15 Joined: 29 Nov 2013
Location: Denmark
Post
by Jokse » Sun Apr 08, 2018 8:59 am
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
Post
by Martin A » Sun Apr 08, 2018 12:23 pm
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
Post
by Jokse » Sun Apr 08, 2018 2:29 pm
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!
BigDumbDinosaur
Posts: 9425 Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:
Post
by BigDumbDinosaur » Sun Apr 08, 2018 9:00 pm
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.
Martin A
Posts: 197 Joined: 02 Jan 2016
Post
by Martin A » Mon Apr 09, 2018 8:02 am
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
Post
by Tor » Mon Apr 09, 2018 8:29 am
Maybe WinCUPL will understand [02FF] as hex, but not [2FF] (without the 'h')?
BigEd
Posts: 11463 Joined: 11 Dec 2008
Location: England
Contact:
Post
by BigEd » Mon Apr 09, 2018 10:39 am
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?
cbscpe
Posts: 491 Joined: 13 Oct 2013
Location: Switzerland
Contact:
Post
by cbscpe » Sun Apr 29, 2018 12:07 am
The default is hex. But it is overwritten when using a prefix, like in your case you say
after that the default is binary.