We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

# AR# 14674

## Description

Keywords: compile, .ce, .clk, .oe, .sr, .ar, .aclr, .aset, .ap

In ABEL, a "set" can be declared to group a set of signals. For example, four registers could be grouped into a set to be used as a counter with the following declaration:

CNT=q3..q0;

A dot extension could then be assigned to each member of the set in one statement. For example, the following statement would assign "myclk" as the clock input to the four registers, q3, q2, q1, q0:

CNT.clk=myclk; "

However, if the assignment is made using a condition statement (i.e., when/then, if/then/else), as in the following example, the dot extension assignment is applied only to the LSB of the set:

when (myclk == 1) then
{
CNT.clk = 1;
}

## Solution

If a set is assigned a variable (pin or node), that variable will be applied to all members of the set. However, if a set is assigned a single value, the value will be padded with 0s, then applied to the set.

For example:

[A1, A2, A3] = 1;

is equivalent to:

A1=0;
A2=0;
A3=1;

Therefore, in the ".clk" example above:

when (myclk == 1) then
{
CNT.clk = 1;
}

is equivalent to:

when (myclk == 1) then
{
q0.clk = 1;
q1.clk = 0;
q2.clk = 0;
q3.clk = 0;
}

The expected logic can be obtained by removing the logic from the conditional statement, or by assigning the complete value as follows:

when (myclk == 1) then
{
CNT.clk = ^b1111;
}
AR# 14674
Date 07/28/2009
Status Archive
Type General Article
Page Bookmarked