diff options
| author | Fuwn <[email protected]> | 2026-02-13 23:26:29 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-13 23:26:29 -0800 |
| commit | db40dbfb19b40d4c245407bbb289cb184e516f51 (patch) | |
| tree | 0bc5da6db24e62216500789ea2c5790408246ffa /lab_5/SRC/generator.sv | |
| parent | Initial commit (diff) | |
| download | cst456-db40dbfb19b40d4c245407bbb289cb184e516f51.tar.xz cst456-db40dbfb19b40d4c245407bbb289cb184e516f51.zip | |
feat(lab_5): Add initial files
Diffstat (limited to 'lab_5/SRC/generator.sv')
| -rw-r--r-- | lab_5/SRC/generator.sv | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lab_5/SRC/generator.sv b/lab_5/SRC/generator.sv new file mode 100644 index 0000000..b85d7ec --- /dev/null +++ b/lab_5/SRC/generator.sv @@ -0,0 +1,19 @@ +import typedef_pkg::*;
+class generator;
+logic [7:0] a;
+logic [7:0] b;
+logic [15:0] out_put;
+operation_t op;
+virtual intf ALUintf;
+function new (virtual interface intf alu_if_in);
+ ALUintf = alu_if_in;
+endfunction
+task sitimulus();
+ ALUintf.execute_op( op, a, b, out_put);
+ `RND_CHECK(std::randomize(op) with {op inside {op};})
+ `RND_CHECK(std::randomize(a))
+ `RND_CHECK(std::randomize(b))
+ ALUintf.execute_op( op, a, b, out_put);
+endtask
+
+endclass
\ No newline at end of file |