-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestrandinsidealt.d
77 lines (58 loc) · 1.36 KB
/
testrandinsidealt.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright: Coverify Systems Technology 2013 - 2014
// License: Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Authors: Puneet Goel <[email protected]>
import std.stdio;
import esdl;
class Bar
{
// mixin(_esdl__randomizable());
// private @rand!(16) ushort bob[];
mixin randomization;
private @rand ubyte foo;
void display() {
import std.stdio;
writeln("foo: ", foo,);
}
// void post_randomize() {
// writeln("Post Randomize Called");
// }
int nobar = 4;
constraint! q{
foo /* + boo*/ <= 64;
// pop % 3 == 0;
} cst02;
constraint! q{
// this is a comment
foo >= 32;
// (42 >= foo && 42 < 47) || 42 == 13 || 42 == 14;
42 inside [foo..47, 13, 14];
} cst01;
// constraint! q{
// foo > bar;
// foo == 0 || foo == 231243432;
// solve foo before bar;
// }
// constraint! q{
// pop1 + mom2 + kid3 > 64;
// pop + kid3 == 24;
// } cst1;
// constraint! q{
// pop < 64;
// mom == 1;
// kid == 4;
// } cst10;
}
void main() {
for (size_t j=0; j!=1; ++j) {
auto foo = new Bar;
foo.seedRandom(100);
for (uint i=0; i!=100; ++i) {
foo.randomize();
foo.display();
}
}
import std.stdio;
writeln("DONE MAIN");
}