Hi all ,
I was going through the following :: OOP Design Pattern Examples
I have a few questions ::
[ A ] " Static properties do not get allocated until specialized "
(a) Allocation ::
(1) Does allocation mean Appropriate Space is reserved for static property ’ counter ’ ?
(2) Can I say allocation occurs at Elaboration time ( for class Specialization ) OR
at Compilation Time ( for static property in Non - Parameterized class ) ?
(b) Initialization ::
(1) Which one of the following 2 statements is correct ::
Static property are initialized at Time 0 OR
Static property are initialized before Time 0
(2) Does static property initialization occur before ALL procedural blocks and before continous assignment
statements ( assign statements ) ?
( c ) " The compiler resolves all class Specializations as part of elaboration process "
Does it mean the following ::
(1) It identifies ALL unique Specializations ( irrespective of the Time during which the statements would be executed )
and initializes their static properties ?
Eg :: initial begin
#10 ;
$display( Stack #( bit ) :: counter ) ;
end
So even though the $display statement gets executed at Time : 10 the compiler identifies the class
Specialization at elaboration time and initializes it at / before Time : 0
[ B ] Static variable initialization ordering ::
Root my_root = Root :: get() ;
MyComponent me = new( "me" , my_root ) ;
(1) Do initialization during declaration occur at the same time static properties are initialized ?
i.e Possible race condition between them
[ C ] Static property initialization in Non - Parameterized class ( via Specialization ) V/S
**Static property initialization in Parameterized class**
(1) Do both occur at Same time OR are static properties in Non - Parameterized initialized before
static property initialization in Parameterized class ?
Eg :: If I were to assign a static property ( LHS ) a static property of Non - Parameterized class ( RHS )
**Will there exist a Race Condition ?**