6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat May 04, 2024 6:40 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: WinCUPL question(s)
PostPosted: Sun Apr 08, 2018 8:59 am 
Offline

Joined: Fri Nov 29, 2013 7:08 am
Posts: 15
Location: Denmark
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:
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:
  17:output.d = input:[0..2FF];
                           ^
[002ca] invalid number: 2FF
[002ca] invalid number: 2FF
[002ca] invalid number: 2FF
Total time: 0 secs


Top
 Profile  
Reply with quote  
 Post subject: Re: WinCUPL question(s)
PostPosted: Sun Apr 08, 2018 12:23 pm 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
It would appear to work if you use 'h'2ff instead of just 2ff. Not sure why the explicit hex definition is needed though.


Top
 Profile  
Reply with quote  
 Post subject: Re: WinCUPL question(s)
PostPosted: Sun Apr 08, 2018 2:29 pm 
Offline

Joined: Fri Nov 29, 2013 7:08 am
Posts: 15
Location: Denmark
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!


Top
 Profile  
Reply with quote  
 Post subject: Re: WinCUPL question(s)
PostPosted: Sun Apr 08, 2018 9:00 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8172
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
 Post subject: Re: WinCUPL question(s)
PostPosted: Mon Apr 09, 2018 8:02 am 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
I always thought hex was the default, the following code from one of my projects compiles correctly without any explicit 'h' declarations.

Code:
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  ;



Top
 Profile  
Reply with quote  
 Post subject: Re: WinCUPL question(s)
PostPosted: Mon Apr 09, 2018 8:29 am 
Offline

Joined: Sun Apr 10, 2011 8:29 am
Posts: 597
Location: Norway/Japan
Maybe WinCUPL will understand [02FF] as hex, but not [2FF] (without the 'h')?


Top
 Profile  
Reply with quote  
 Post subject: Re: WinCUPL question(s)
PostPosted: Mon Apr 09, 2018 10:39 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
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:
output.d = input:[000..2FF];


Top
 Profile  
Reply with quote  
 Post subject: Re: WinCUPL question(s)
PostPosted: Sun Apr 29, 2018 12:07 am 
Offline
User avatar

Joined: Sun Oct 13, 2013 2:58 pm
Posts: 485
Location: Switzerland
The default is hex. But it is overwritten when using a prefix, like in your case you say


Code:
output.ar = ´b´0


after that the default is binary.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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: