OpenCores
URL https://opencores.org/ocsvn/s80186/s80186/trunk

Subversion Repositories s80186

[/] [s80186/] [trunk/] [tests/] [rtl/] [ModRMTestbench.sv] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jamieiles
// Copyright Jamie Iles, 2017
2
//
3
// This file is part of s80x86.
4
//
5
// s80x86 is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// s80x86 is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
// GNU General Public License for more details.
14
//
15
// You should have received a copy of the GNU General Public License
16
// along with s80x86.  If not, see .
17
 
18
module ModRMTestbench(input logic clk,
19
                      input logic reset,
20
                      // Control.
21
                      input logic start,
22
                      output logic busy,
23
                      output logic complete,
24
                      input logic clear,
25
                      // Results
26
                      output logic [15:0] effective_address,
27
                      output logic [2:0] regnum,
28
                      output logic rm_is_reg,
29
                      output logic [2:0] rm_regnum,
30
                      output logic bp_as_base,
31
                      // Registers.
32
                      output logic [2:0] reg_sel[2],
33
                      input logic [15:0] regs[2],
34
                      // Fifo Read Port.
35
                      output logic fifo_rd_en,
36
                      input logic [7:0] fifo_rd_data,
37
                      input logic fifo_empty);
38
 
39
wire immed_is_8bit;
40
wire immed_start;
41
wire immed_complete;
42
wire immed_fifo_rd_en;
43
wire modrm_fifo_rd_en;
44
wire [15:0] immediate;
45
 
46
assign fifo_rd_en = immed_fifo_rd_en | modrm_fifo_rd_en;
47
 
48
ImmediateReader ir(.clk(clk),
49
                   .reset(reset),
50
                   .start(immed_start),
51
                   // verilator lint_off PINCONNECTEMPTY
52
                   .busy(),
53
                   // verilator lint_on PINCONNECTEMPTY
54
                   .complete(immed_complete),
55
                   .is_8bit(immed_is_8bit),
56
                   .immediate(immediate),
57
                   .fifo_rd_en(immed_fifo_rd_en),
58
                   .fifo_rd_data(fifo_rd_data),
59
                   .fifo_empty(fifo_empty));
60
 
61
ModRMDecode mrm(.clk(clk),
62
                .reset(reset),
63
                .start(start),
64
                .busy(busy),
65
                .complete(complete),
66
                .clear(clear),
67
                .effective_address(effective_address),
68
                .regnum(regnum),
69
                .rm_is_reg(rm_is_reg),
70
                .rm_regnum(rm_regnum),
71
                .bp_as_base(bp_as_base),
72
                .reg_sel(reg_sel),
73
                .regs(regs),
74
                .fifo_rd_en(modrm_fifo_rd_en),
75
                .fifo_rd_data(fifo_rd_data),
76
                .fifo_empty(fifo_empty),
77
                .immed_start(immed_start),
78
                .immed_complete(immed_complete),
79
                .immed_is_8bit(immed_is_8bit),
80
                .immediate(immediate));
81
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.