Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[Verilog] Write the testbench to simulate the behaviours of module mymem : To describe an inferred RAM in Verilog, there have some following signals: clk:

[Verilog] Write the testbench to simulate the behaviours of module mymem:

  1. To describe an inferred RAM in Verilog, there have some following signals:
  • clk: clock;
  • rdata: output read data from RAM;
  • address: read/write address;
  • wdata: data that will be write to RAM;
  • wen: allow to the wdata write to RAM at address.
  1. Describe RAM as an array.
  2. Read/write activity have to be triggered by a clock. Reset/Set is not allowed when using RAM.
  3. The direct output of RAM have to be captured by a register before assign to rdata. Otherwise, RAM is not infered

To know your RAM design inferred successfully. Synthesize then look at "Design Run" tab in Vivado, if the value at the column "BRAM" or "URAM" is higher than 0, it means there are RAM that is inferrred.

image text in transcribed

1 module mymem (clk, rdata, addr, wen, wdata); 2 3 input clk; 4 output [31:0] rdata; 5 input [9:0] addr; 6 input wen; 7 input [31:0] wdata; reg [31:0]mem[0:1023]; reg [31:0]rdout; always @(posedge clk) begin if (wen) mem[addr]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions