Professional Documents
Culture Documents
$date
Sep 26 2000 16:28:52
$end
$version
FREEHDL 0.1
$end
$times
ale
1 us
$end
$s
ope module stru
t $end
$var reg 8 ! qsig2[8:1 $end
$var reg 8 " qsig[8:1 $end
$var trireg 1 ?
lk $end
$ups
ope $end
$enddefinitions $end
#0
$dumpvars
b110100 !
b110100 "
b0 ?
#100
b110100 !
b1 ?
$end
Figure 1: VCD File
pro
ess(a,b)
begin
<= a xor b;
d <=
and a;
end pro
ess;
Figure 2: VHDL model 1
= a XOR b
(1)
= AND a
(2)
and
pro
ess
begin
if
lk'event and
lk = '1' then
<= a xor b;
d <=
and a;
end if;
end pro
ess;
Figure 4: VHDL model 1
that attach each set of signals to the other. The first operation (equation (1)) describes the relationship between the signals a, b and c
and the second one (equation (2)) describes the relationship between the signals a, c and d. Notice that the storage of these equations should be done just once a time for each waveform compression process.
Let see, what will happen when we consider a VHDL model, which
depends on clock signal. Figure 4 shows the previous example in
the case where the process P depends on a clock signal clk.
We see that in the VHDL model of figure 4, the considered process
depends whether the clock signal clk changes value or not to assign
signal values to c and d. Although, signals c and d will change value
with a cycle delay of clock signal compared to signals a and b. Figure 5 describes the signal assignment structures for VHDL language
in the case of ideal electrical circuits without any component delays.
We notice that there is a clock cycle delay between the two assignments and the a and b signal values. I.e. that the signal assignment
will be achieved just after a delay of clock signal cycle.
In order to make synthesizable models and due to the VHDL language structure in the signal assignment, we notice that the previous
relationship between c, a and b, and d, c and a will not be valid in
the case of this VHDL model that depends on clock signal. Therefore, we must define new relationships between these signals, which
depend on the clock signal clk.
Figure 6 represents the CDFG of the VHDL model shown in figure 4.
Notice that this graphical representation describes the relationships
between all signals in this VHDL model. Thereby, the incoming data
edges a and b of the XOR node come from the Read Signal node,
which represents the source of out-coming data edges, however the
out-coming data edge c is an incoming edge of the Write Signal
node, which represents the source of incoming data edges. Between
Read Signal node and Write Signal node there is just one clock
signal cycle delay. After a clock signal cycle, the value of signal c
will be transfered to Read Signal node. On the other hand, the
5
(n)
= f (a n ; b n )
(
1)
1)
(3)
f (x; y) = x XOR y
(4)
d(n)
= f (
n ; a n )
(
1)
1)
(5)
f (x; y)
= x AND y
(6)
= f (a; 1)
(7)
f (x; y) = x XOR y
= f (b; 1)
(8)
(9)
f (x; y) = x NOR y
d
(10)
= f ( ; 1)
(11)
f (x; y) = x XOR
(12)
Above, we presented the case when the processes depend on signals. Let us look, what will happen when there are processes, which
depend on clock signal inside a considered model.
S (n+1)
Where
tion.
= f (Si n ; Sj n ))
( )
( )
(13)
The more complex case is the case where each process has
its own clock signal. In this case, we must define a relationship between all clock signals, and try to write the other clock
signals function of the first one for example. If we suppose
for example that the clock signal
lkk is slower k times than
the clock signal
lk0 , and the clock signal
lkp is p times faster
than signal clock
lk0 , we can write the following relationships
between the distinguished clock signals:
= k lk
lkk
lkp
(14)
= 1=p lk
(15)
Sl 0 (n)
= f (Si
0
(n
1)
; Sj k (E ((n
1)=k ))
; Shp (p(n
1))
(16)
E (x)
Slk (n)
Slp (n)
= fk (Si
= fp(Si
(k (n
(E ((n
1))
1)=p))
; Sj k (n
1)
; Sj k (E ((n
; Shp(kp(n
1)=(pk )))
1))
; Shp (n
(18)
1)
(19)
9
lk1
= 3 lk
(20)
and
lk2
= 0:5 lk
(21)
b(n+1)
= a n XOR 1
( )
(22)
(k+1)
= b k NOR 1
( )
(23)
d(m+1)
=
m XOR 1
(
(24)
Sk
(25)
where Sp0 ; :::; Spi are independent or primery signals and Sj ; ::; Sn
are signals that depend of each other and the other signals.
For example, let consider the following signal dependencies:
Sj
= fj (S ; ::; Sl )
(26)
Sm
= fm(S ; S )
(27)
= fl (S )
(28)
= fn(S ; Sh; Sm )
(29)
Sl
Sn
In section 4.1.1, we will just store the signals that do not depend of any other signal. For example Sp0 ; :::; Spi . Therefore, the decompression process complexity will depend on the
complexity of the functions f0 (); :::; fn (). Notice that these functions can be as complex as possible and so the decompression
task will be so complex. To solve this problem, we can precede
as follows:
12
13
must be stored.
Sk = Fk (S0 ; :::; Si )i = 0 n
minimize the dependency function complexity:
be written in the following form:
Ck =
X
i
Cki =
X
i;j
(30)
i wi Cij
(31)
j is defined as follows:
(
Sj value not stored in DDB
j = 10 :: otherwise
(32)
(33)
: so on
14
i SSi
pi = P
n
j SSj
(34)
j =0
pi=j =
j SSj
i SSi
j
= j SS
n
P
pi l
(35)
l=0
8
>
( 1 PC )
< min
m m i;j ki
Pp )
OP : >
1
(
i
: min
m
m
i
(36)
From this optimization problem, we can say that the needed storage
space and the dependency function complexity are inversely (conversely) proportional. So, we can define a new space composed of
15
the complexity and the probability as shown in figure 12. This allows
us to consider the function to minimize as follows:
1 Xd )
min
(
im
k k
2
(37)
dim = d(Xi ; Xm ) =
and
(38)
dm = min
(di ) k di =
i
( pAi ) + ( CBki )
2
(39)
The Xmin (pm ; Ckm ) is chosen with the manner that Sm = fm (Sj )j 2
f0 ng is composed of independent signals only. This means that
all Sj are independent.
So, the problem we are dealing with can be written as follows:
1 X (p p ) + (C C ) )
min
(
i
m
ki
km
l l
2
(40)
0 p 1
i
B
.
.. C
B
C
B
C
B
C
p
B
k C k min( 1 (X T M X + V X + K )) (41)
8k 2 fi hg k Xk = B
k k
k
k k k
B
C
Cik C
k k
B
C
B
... C
A
Ckk
where :
0
B
B
B
B
B
B
B
Mk = B
B
B
B
B
B
B
1
1
0 1
0 0 C
2
A
C
B
0 A12 0 0 C
C
B
C
C
B
.. C 0 0
..
..
B
C
C
. . . A
C
1
C
0 0 A2 0
C
1
1
C
0
0
2
C
B
C
C
B
1
0
0
0
C
C
B
B2
C
B
00
.. C C
..
..
B
A
. . . A C
B2
16
the matrix of quadratic optimization. This matrix is (2k; 2k ) dimension. I.e Mk 2 R2k2k . We can demonstrate that the
matrix Mk is symmetric and positive definite, which means
MkT = Mk and 8x 2 R2k1 : xT Mk x > 0.
0
B
B
B
B
Vk = 2 B
B
B
B
B
0 pm 1
A
B
... C
A
pm
0 CAmk 1
B C
B
.
B
A
.. C
Ckk
B
1
C
C
C
C
C
,
C
C
C
C
A
0
B
B
B
B
B
Kk = B
B
B
B
B
B
is 2k .
p2i
A2
..
.
p2k
A22
Ckm
B2
..
.
2
Ckk
B2
1
C
C
C
C
C
C
is a constant vector. The length of this vector
C
C
C
C
C
A
(42)
that succeeds:
8 min ( 1 P C ) = ( 1 P C )
<
ki
ki opt
m
m
8m k Xm = fSigi2f0mg k : ki=0=0nn1 P
P
min
( p(Si)) = ( m1 pi)opt
m m
(43)
18
1
Cik ; m1 pi ). Let associate to this solution a
as follows: ( m
chance probability qm that satisfies 0 < qm < 1.
we know that for our no pt we have the best chance to get the
P
P
optimal solution ( no1pt Cik ; no1pt pi )of our OP solution. So,
8m 2 f0 kg we have the following condition to be verified :
1 > qnopt qm > 0. The Figure 13 shows the variation of the
chance to get an optimal solution function of the considered
signal sets.
19
q(Xi ) = exp(
(44)
Xnopt ,
we can
Proof: to prove the equation above, just consider the case of the
p-variate normal distribution for multivariate with p = 2k [5].
So, we can use this equation as a constraint for the optimization
problem defined in equation (41). Always, we can fix the chance to
obtain an optimal solution of considered optimization problem, and
than search the corresponding signal sets which succeeds considered chance probability.
For example is we would like that the chance of getting an optimal solution must be greater than 0:7, we can consider the following
quadratic optimization problem:
8
>
( 1 (X T Mk Xk + Vk Xk + Kk ))
< min
k k k
1
T
>
: (2)k p1det(Mk ) exp( (Xk Xnopt ) M2k (Xk
Xnopt )
) 0:7
(46)
0S 1
i
B C
where k represents the length of the vector Xk = ... A that must
be identified.
Sk
Sn = Fn (S0 ; ; Sn
(47)
where
Si = Fi (S0 ; ; Sk ) k i; k = 0 n
(48)
So, to calculate Fn () we need first to calculate Fi (). So, the complexity of the function Fn (), will be calculated based on the function
complexities Fi ():
Cn =
n
X
i=0
wi Ci
(49)
min
( wiCi )
n
(50)
i=0
a(n)
= an
(
1)
XOR 1
(51)
P: pro
ess
begin
if
lk'rising_edge then
a <= a xor '1';
end if;
end pro
ess;
Figure 14: VHD model 5
Notice that this equation allows us to restore the signal a at the clock
signal cycle n base on the value of this signal at the clock signal
cycle (n 1). So, we can just store the value of this signal at the first
clock signal cycle and then we can calculate the value of considered
signal recursively. Although the problem is that this calculation of the
value of signal a at the clock signal cycle n is so complex and need
a great schedule time.
To solve this compromise between these problems, we need to find a
solution that reduces the schedule time needed for the restore of the
signal a at the clock signal cycle n, when n is so great so possible
and the storage space needed for the storage of signal a each clock
signal cycle.
Problem formulation: The problem we are going to consider may
be formulated as follows:
8n 2 IN : S n = fn(S n )
( )
find
nopt =
1)
( min((n 1) SS (a))
n
min
((n 1) C )
n
(52)
(53)
p 2 IN : n = ip where 1 i p
(54)
8n; p 2 IN : S n = fnp(S p )
(55)
such as
( )
( )
For each clock signal cycle n, we will try to find an integer p, that
allows to store the signal value S (ip) that minimize the time schedule
22
p 2 IN : p
S (n) .
Arbitrary, we can
n
1 10
p k i = 19
(56)
24
Parameter Value Decompression module: this module decompresses all parameter values based on the
information stored in the compressed VCD file and
those returned from the Dependency simulator.
Dependency Simulator module: this module allows to
simulate the stored dependencies between parameters and returns either the parameter value or the the
Simulation Time.
5 Time Schedule
In this section we presents the needed time to achieve each module
of this software.
6 Conclusion
In this document, we presented an idea of using CDFG to improve
the developed waveform compression technique. Two cases for using CDFG in the waveform compression are developed: simple case,
which interests the signal and process dependencies, and complex
case that interests the other VHDL statements. We can conclude
that the CDFG advantages are to allow a rapid interpretation of the
26
27
7 Reference
[1] E. Naroska, A Novel Approach for Digital Waveform Compression.
[2] E. Naroska, Waveform Compression Technique.
[3] E. Naroska and S. Mchaalia, Control Data Flow Graph for FreeHDL compiler.
[4] J. Ziv and A. Lempel,A Universal Algorithm for Sequential Data
Compression, IEEE Transaction on Information Theory, Vol. IT-23,
No.03, May 1997. [5] The multivariate Normal Distribution, basic
course.
List of Figures
28