Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The aim of this task is to create a self - checking testbench for a data transformation program. program. The program assigns different values to
The aim of this task is to create a selfchecking testbench for a data transformation program. program. The program assigns different values to the output signal TransformedData depending on the input signals Mode and Data.
The data transformer has three different modes:
In mode Mode an additional header is added to Data and the result
TransformedData is assigned.
In Mode mode, the data is encrypted. First, the bitwise XOR of Data and AA is calculated and the result is then assigned to TransformedData together with a header
In Mode the last bits are extracted. To do this, the bitwise AND
of Data and F is calculated and the result is then assigned together with a header to
TransformedData.
In all other cases, TransformedData is simply set to bits
Headers are always added to the front of the result. For example, for Mode the following applies
TransformedDatab Data 'hAA;
Note: The "encoding" used here serves as a simple example. In reality, it would only be secure if AA is replaced by a dynamically and randomly selected key.
The data transformer has the following interface:
module datatransformer
input logic : Data
input logic : Mode
output logic : TransformedData ;
Declare the required inputs and outputs and instantiate the module datatransformer as a unit under test UUT the datatransformer module.
Test the UUT in Mode mode for the inputs Data Data and Data
Test the UUT in Mode mode for the inputs Data Data and Data
Test the UUT in Mode for all possible Data inputs.
Test the UUT in Mode for all possible Data inputs.
Display an appropriate, meaningful error message if the UUT works incorrectly for an input.
works incorrectly for an input.
Notes: Since this is a testbench, you may use constructs such as #; if for here without generate etc. in the given initial block. Remember the difference between the operations and Equivalently, there are also operations and The code framework issues a warning "SIMULATION TOOK TOO LONG, STOPPING NOW" if your testbench is too slow.
testbench is too slow. In this case, an infinite loop probably exists in your code by mistake.
Note: You can compile and start your testbench with the following command:
Windows: simbat datatransformer, Otherwise: simsh datatransformer This tests the transformer in datatransformer.sv which is correct, so there should be no errors. should be output. Alternatively, you can also use
Windows: simbat datatransformer custom, Otherwise: simsh datatransformer custom
execute. This tests the Transformer in datatransformererror.sv which should output an error in every mode. an error should be output in every mode.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started