Checker : Legal and Illegal Conditions

5 minutes
Share the link to this page
You need to have access to the item to view this lesson.
One-time Fee
List Price:  $149.95
You save:  $110
List Price:  ₹9,995
You save:  ₹8,515
List Price:  €138.22
You save:  €101.39
List Price:  £117.69
You save:  £86.33
List Price:  CA$205
You save:  CA$150.38
List Price:  A$226.10
You save:  A$165.86
List Price:  S$202.44
You save:  S$148.51
List Price:  HK$1,170.98
You save:  HK$859.01
CHF 36.57
List Price:  CHF 137.29
You save:  CHF 100.71
NOK kr422.78
List Price:  NOK kr1,586.89
You save:  NOK kr1,164.11
DKK kr274.91
List Price:  DKK kr1,031.86
You save:  DKK kr756.95
List Price:  NZ$244.95
You save:  NZ$179.69
List Price:  د.إ550.76
You save:  د.إ404.03
List Price:  ৳17,568.19
You save:  ৳12,887.63
List Price:  RM705.43
You save:  RM517.49
List Price:  ₦219,121.76
You save:  ₦160,742.87
List Price:  ₨41,665.63
You save:  ₨30,564.99
List Price:  ฿5,486.92
You save:  ฿4,025.08
List Price:  ₺4,830.33
You save:  ₺3,543.42
List Price:  B$774.80
You save:  B$568.38
List Price:  R2,761.99
You save:  R2,026.14
List Price:  Лв270.20
You save:  Лв198.21
List Price:  ₩204,936.66
You save:  ₩150,337
List Price:  ₪548.70
You save:  ₪402.51
List Price:  ₱8,727.76
You save:  ₱6,402.49
List Price:  ¥23,533.90
You save:  ¥17,263.95
List Price:  MX$2,504.13
You save:  MX$1,836.97
List Price:  QR546.15
You save:  QR400.64
List Price:  P2,034.93
You save:  P1,492.78
List Price:  KSh19,545.24
You save:  KSh14,337.95
List Price:  E£7,066.37
You save:  E£5,183.73
List Price:  ብር8,605.70
You save:  ብር6,312.95
List Price:  Kz127,211.43
You save:  Kz93,319.49
List Price:  CLP$135,949.16
You save:  CLP$99,729.30
List Price:  CN¥1,066.21
You save:  CN¥782.15
List Price:  RD$8,820.01
You save:  RD$6,470.17
List Price:  DA20,161.67
You save:  DA14,790.16
List Price:  FJ$340.03
You save:  FJ$249.44
List Price:  Q1,163.43
You save:  Q853.46
List Price:  GY$31,335.65
You save:  GY$22,987.14
ISK kr5,521.09
List Price:  ISK kr20,723.09
You save:  ISK kr15,202
List Price:  DH1,493.97
You save:  DH1,095.94
List Price:  L2,657.05
You save:  L1,949.15
List Price:  ден8,512.61
You save:  ден6,244.66
List Price:  MOP$1,205.29
You save:  MOP$884.17
List Price:  N$2,752.65
You save:  N$2,019.28
List Price:  C$5,512.51
You save:  C$4,043.85
List Price:  रु19,917.99
You save:  रु14,611.39
List Price:  S/559.92
You save:  S/410.75
List Price:  K582.06
You save:  K426.98
List Price:  SAR562.28
You save:  SAR412.47
List Price:  ZK3,997.46
You save:  ZK2,932.45
List Price:  L687.70
You save:  L504.48
List Price:  Kč3,405.72
You save:  Kč2,498.36
List Price:  Ft53,045.85
You save:  Ft38,913.26
SEK kr426.20
List Price:  SEK kr1,599.72
You save:  SEK kr1,173.52
List Price:  ARS$133,531.97
You save:  ARS$97,956.09
List Price:  Bs1,034.94
You save:  Bs759.21
List Price:  COP$579,518.37
You save:  COP$425,121.85
List Price:  ₡76,788.33
You save:  ₡56,330.22
List Price:  L3,701.25
You save:  L2,715.16
List Price:  ₲1,126,542.82
You save:  ₲826,406.87
List Price:  $U5,763.95
You save:  $U4,228.31
List Price:  zł587.85
You save:  zł431.23
per week
Payment Plan
per week
4 payments
Already have an account? Log In


Hello and welcome to this short lecture on legal and illegal conditions of a checker. So, I have declared a checker for my check. And inside that I have a variable my bit of type bit. Now in the initial block, you would like to assign a value to this variable my bit, but that is illegal. Now, that seems like a real limitation. But there are ways around it.

And one of the ways that you can assign a value directly during the declaration of the variable. So if you say bit my beta equal to one, then that is legal. But what if you want to have some kind of a complex condition here, some addition, subtraction, or shift operation or something like that, you cannot do that directly in the initial block. So there is a way around it that I'll show you in the next slide. In addition I have to get the same checker here with the same bit my bit. And I'm instantiating my check here, with MC k one being the instance name, I'd like to display my bit from the instance MC k one.

So normally, you would do this if you had a module and everything would be fine. But you cannot hierarchically reference a variable in the instance of a checker. That is illegal. And you can pass declare a formal here and then get an actual during the instantiation. And that is another way that you can access internal base, but that's kind of a workaround, you cannot directly access hierarchical bits or hierarchical references. So as I showed in the previous slide, if you do want to assign up value to a variable inside the initial blog, you can do that we are using a function.

So you can have a function call on the right hand side, and then you can assign whatever value the function returns to your variable. So here what I've done is I have declared a function called return a value, and I'm returning a plus one. So a will be equal to a plus one. But the important thing to note here is that big a, I have not passed it, when I call return a value because it is visible since the function is within the scope of the checker. So that's a good feature. And so this is one way you can assign values to variables in the initial block and then you can have anything complex that you like here or you can do anything you like to go in a function.

This is a very simple point here. I have declared Add my bus to be of type logic a bit wide. And what I'm saying is that at the edge of claw assign one colon zero equal to zero and assign seven colon one equal to one. And you know notice that the big one is overlapping between these two parts selects, that is illegal in a module. This is also from a design point of view illegal button system or one complaint. The if you run a link type to then the Link Type tool will flag this as a violation.

Because you know you probably did that by a typewriter for example. So, if you do not overlap one colon zero and seven colon two, then everything is fine. Meaning you can assign values to parts elects in a checker. This is another finer point. Again, in the checker, my check I have two inputs buss and I bought our four bits wide. Now inside the initial block, I'm saying that bus I bus that uses is an index will be some return value.

This part is the same as what I showed you in the earlier slide. So I'm just returning bus plus one. Now, in my module, my mod, I'm instantiating the checker twice my check am one and here I'm passing two variables data from bus and bus index. Well, these index i cannot be a variable. So you cannot pass a non constant value on bus index bus index is the actual for I formal, but you can indeed Pass a constant value on the index. So the rule of thumb is that it is illegal to pass non constant index value to a checker variable which is used on the left hand side of an assignment.

There is another point also that if you insane shit a checker meaning let's say you want to create multiple checkers from a loop, then the loop index cannot be used as actual for the checker variable. So that's another thing that you may miss. And hopefully this clarifies it. So that's all very short and sweet lecture. Hopefully it's of help to you. Thank you.

Sign Up


Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.