6502.org
http://forum.6502.org/

Fitter error - no .CLK in .olb
http://forum.6502.org/viewtopic.php?f=10&t=7216
Page 1 of 1

Author:  speculatrix [ Mon Jun 27, 2022 9:49 am ]
Post subject:  Fitter error - no .CLK in .olb

So I'm trying to teach myself CPLD programming and just ran out of talent. I've got some decoding logic working fine and decided the next step would be to implement a counter on an ATF1502S.

I figured I'd start on the nursery slopes with a simple decade counter. When I try to compile this, however, I get an error. The compilation, with cupl.exe, works fine. But when I run find1502.exe, I get the error:

Code:
Atmel ATF1502AS Fitter Version 1.8.7.8 (02-05-03)
Copyright 1999,2000 Atmel Corporation
Error - Node Q3 is registered and there is no .CLK in .olb
Reading input file failed ...


Here is my code:

Code:
Name      COUNT10;
Partno    00;
Date      27/06/2022;
Revision  01;
Designer  SMD;
Company   ;
Assembly  ;
Location  ;
Device    f1502tqfp44;

/***************************************************************/
/* Decade Counter                                              */
/***************************************************************/

/**  Inputs  **/
PIN 15        = pulse;           /* Counter clock              */
PIN 44        = clr;             /* Counter clear input        */

/**  Outputs  **/
PIN [28,25,22,19] = [Q3..0];     /* Counter outputs on LEDs    */

FIELD count = [Q3..0];          /* Counter output bit field    */
$repeat i = [0..9]
$define S{i} 'b'{i}             /* Creates S0-S9 with vals 0-9 */
$repend

/** State machine **/
SEQUENCE count {
$repeat i = [0..9]
  present S{i}
     if pulse next S{(i+1)%10};
    if clr next S0;
     default next S{i};
$repend
}


I'm compiling with:

Code:
C:\Wincupl\Shared\cupl.exe -j -a -l -e -x -f -b -m4 f1502tqfp44 COUNT10


And running find1502 with:

Code:
find1502 -i E:\NasSync\DEV\Dev-PLD\CUPL_Projects\COUNT10\COUNT10.tt2 -CUPL -dev P1502T44 -str JTAG ON -str logic_doubling off


I rechecked my previous projects and they're still working fine, so I haven't borked my dev setup.

What am I doing wrong?

[EDIT] Just realised that Atmel docs actually have this precise thing as an example. I'll be back once I've read that.
[EDIT 2] Turns out the Atmel example was the code on which I'd based mine anyway. And the Atmel code produces the same error, even when I remove all specific pin assignments and let the fitter decide on pins.

Author:  CountChocula [ Mon Jun 27, 2022 4:04 pm ]
Post subject:  Re: Fitter error - no .CLK in .olb

Howdy! I think the problem is that the way you're using the PULSE signal leads to behaviour that's not what you expect. In your state machine, PULSE is used as a combinational input—basically, you're asking the PLD to only count forward if PULSE is active.

This doesn't actually make the PLD use that signal as a clock; instead, I think you have to explicitly define the clock used by the FSM's flip-flops by using the .CK extension. Try something like this—this compiles fine for me, but I don't have any ATF-15 devices to test with, so I'm not sure if it's right:

Code:
Name      COUNT10;
Partno    00;
Date      27/06/2022;
Revision  01;
Designer  SMD;
Company   ;
Assembly  ;
Location  ;
Device    f1502tqfp44;

/***************************************************************/
/* Decade Counter                                              */
/***************************************************************/

/**  Inputs  **/
PIN 15        = pulse;           /* Counter clock              */
PIN 44        = clr;             /* Counter clear input        */

/**  Outputs  **/
PIN [28,25,22,19] = [Q3..0];     /* Counter outputs on LEDs    */

FIELD count = [Q3..0];          /* Counter output bit field    */
$repeat i = [0..9]
$define S{i} 'b'{i}             /* Creates S0-S9 with vals 0-9 */
$repend

/** Define clock source for flip-flops **/
Q0.CK = pulse;
Q1.CK = pulse;
Q2.CK = pulse;
Q3.CK = pulse;

/** State machine **/
SEQUENCE count {
$repeat i = [0..9]
  present S{i}
    if clr next S0;
    default next S{(i+1)%10};
$repend
}


I think that the examples in the book are meant for devices (like the 22V10) that have a single clock line, and so which clock signal to use is implicit; I believe that, on the ATF15, you can use any input as a clock, and so it looks like you have to explicitly set it.

I hope this helps!



—Marco

Author:  speculatrix [ Mon Jun 27, 2022 7:57 pm ]
Post subject:  Re: Fitter error - no .CLK in .olb

I'll give that a whirl. Many thanks.

Author:  speculatrix [ Tue Jun 28, 2022 9:21 am ]
Post subject:  Re: Fitter error - no .CLK in .olb

Yep, that did the trick!

The clr button has no effect, but hey - one problem at a time!

EDIT: This sorted the clr button:

Code:
Q0.ar = clr;
Q1.ar = clr;
Q2.ar = clr;
Q3.ar = clr;

Author:  CountChocula [ Tue Jun 28, 2022 12:01 pm ]
Post subject:  Re: Fitter error - no .CLK in .olb

Glad that worked! I didn't even think about the asynchronous reset… I guess it makes sense that you'd have to specify it as well (at least as far as anything ever makes sense with WinCUPL…). Cheers!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/