As I know the class is used to combine properties and methods like task and function etc... .
But, here is my question that what if there are 3 tasks, then I want to make 2 classes.
For exampl, c1 of class be consisted with a,b tasks and c2 of class be consisted with b,c tasks.
So is this proper methodology by using class?
And what is the benefit by using class instead of using directly use task and function?
Classes are very useful when encapsulating data structures and separating cycle based simulation from transaction level modelling.
For example - you can design a class that encapsulates a data packet, and they build up a stream of data packets away from the cycle based interface - this makes data generation and prediction much easier.
But, here is my question that what if there are 3 tasks, then I want to make 2 classes.
For exampl, c1 of class be consisted with a,b tasks and c2 of class be consisted with b,c tasks.
So is this proper methodology by using class?
And what is the benefit by using class instead of using directly use task and function?
class C1 - contains task a, task b
class C2 - contains task b, task c
Best way to achieve this in any Object Oriented Programming such as SV.
define class C1 with task a and b.
extend class c2 from class c1 and define with task c in it.
Benefit: you don't have to redefine task b in class c2 as c2 will have access to all task/variables of c1. Please refer to concepts of OOP in SV or any language to understand more.