MemTrans - EDA Playground
Warning! This exercise has been opened in another tab; autosave has been disabled. Close this tab or refresh to reactivate.

 Languages & Libraries

 Tools & Simulators

 Examples

205


33
 
1
2
class MemTrans;
3
  
4
  // properties
5
  logic [7:0] data_in;
6
  logic [3:0] addr;
7
  logic       write;
8
9
  // methods
10
  function new();
11
    data_in = 8'd0;
12
    addr = 4'd0;
13
    write = 1'd0;
14
  endfunction
15
  
16
  function void display();
17
    $display("data_in = 0x%h", data_in);
18
    $display("addr = 0x%h", addr);
19
    $display("write = %b", write);
20
  endfunction
21
  
22
endclass
23
24
25
module mem_test ();
26
  MemTrans tr;
27
  
28
  initial begin
29
    tr = new();
30
    tr.display();
31
  end
32
  
33
endmodule
2
 
1
// Code your design here
2
71 views and 0 likes     
A short description will be helpful for you to remember your playground's details
 
100:0