forked from deoregaurav92/SystemVerilog_Coding_Practice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
top.sv
38 lines (32 loc) · 1.06 KB
/
top.sv
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
///////////////////////////////////////////////////////////////////////////
// (c) Copyright 2013 Cadence Design Systems, Inc. All Rights Reserved.
//
// File name : top.sv
// Title : top module for Memory labs
// Project : SystemVerilog Training
// Created : 2013-4-8
// Description : Defines the top module for memory labs
// Notes :
// Memory Lab - top-level
// A top-level module which instantiates the memory and mem_test modules
//
///////////////////////////////////////////////////////////////////////////
module top;
// SYSTEMVERILOG: timeunit and timeprecision specification
timeunit 1ns;
timeprecision 1ns;
// SYSTEMVERILOG: logic and bit data types
bit clk;
wire read;
wire write;
wire [4:0] addr;
wire [7:0] data_out; // data_from_mem
wire [7:0] data_in; // data_to_mem
// SYSTEMVERILOG:: implicit .* port connections
mem_test test (.*);
// SYSTEMVERILOG:: implicit .name port connections
mem memory ( .clk, .read, .write, .addr,
.data_in, .data_out
);
always #5 clk = ~clk;
endmodule