Added back wishbone verification tests, specifically those related

to areas not part of the management SoC, including chip_io,
mgmt_protect, and mprj_ctrl and sysctrl_wb (which are now part of
housekeeping).  The two housekeeping tests fail and need to be
debugged.
This commit is contained in:
Tim Edwards 2021-10-28 17:26:06 -04:00
parent 11165bfe3d
commit 787f1c3dae
11 changed files with 6122 additions and 0 deletions

View File

@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# ---- Test patterns for project striVe ----
.SUFFIXES:
.SILENT: clean all
PATTERNS = mgmt_protect chip_io mprj_ctrl sysctrl_wb
all: ${PATTERNS}
for i in ${PATTERNS}; do \
( cd $$i && make -f Makefile $${i}.vcd &> verify.log && grep Monitor verify.log) ; \
done
clean: ${PATTERNS}
for i in ${PATTERNS}; do \
( cd $$i && make clean ) ; \
done
.PHONY: clean all

View File

@ -0,0 +1,54 @@
# SPDX-FileCopyrightText: 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
PDK_PATH = $(PDK_ROOT)/sky130A
VERILOG_PATH = ../../../
RTL_PATH = $(VERILOG_PATH)/rtl
SIM ?= RTL
.SUFFIXES:
PATTERN = chip_io
all: ${PATTERN:=.vcd}
%.vvp: %_tb.v
ifeq ($(SIM),RTL)
iverilog -Ttyp -DFUNCTIONAL -I $(PDK_PATH) -I $(VERILOG_PATH) -I .. -I $(RTL_PATH) \
$< -o $@
endif
ifeq ($(SIM),SPLIT_BUS)
iverilog -Ttyp -DFUNCTIONAL -DSPLIT_BUS -I $(PDK_PATH) -I $(VERILOG_PATH) -I .. -I $(RTL_PATH) \
$< -o $@
endif
ifeq ($(SIM),GL)
iverilog -Ttyp -DFUNCTIONAL -DGL -I $(PDK_PATH) -I $(VERILOG_PATH) -I .. -I $(RTL_PATH) \
$< -o $@
endif
%.vcd: %.vvp check-env
vvp $<
check-env:
ifndef PDK_ROOT
$(error PDK_ROOT is undefined, please export it before running make)
endif
clean:
rm -f *.vvp *.vcd
.PHONY: clean all

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,377 @@
// SPDX-FileCopyrightText: 2020 Efabless Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// SPDX-License-Identifier: Apache-2.0
`default_nettype none
`timescale 1 ns / 1 ps
`define UNIT_DELAY #1
`define USE_POWER_PINS
`define SIM_TIME 100_000
`include "libs.ref/sky130_fd_io/verilog/sky130_fd_io.v"
`include "libs.ref/sky130_fd_io/verilog/sky130_ef_io.v"
`include "libs.ref/sky130_fd_io/verilog/sky130_ef_io__gpiov2_pad_wrapped.v"
`include "defines.v"
`ifdef GL
`include "gl/chip_io.v"
`else
`ifdef SPLIT_BUS
`include "ports.v"
`include "chip_io_split.v"
`else
`include "pads.v"
`include "mprj_io.v"
`include "chip_io.v"
`endif
`endif
module chip_io_tb;
wire clock_core;
reg clock;
wire rstb_h;
reg RSTB;
reg porb_h;
wire por_l;
wire gpio;
reg gpio_out_core;
reg gpio_inenb_core;
reg gpio_outenb_core;
wire flash_csb;
reg flash_csb_core;
reg flash_csb_ieb_core;
reg flash_csb_oeb_core;
wire flash_clk;
reg flash_clk_core;
reg flash_clk_ieb_core;
reg flash_clk_oeb_core;
wire flash_io0;
wire flash_io0_di_core;
reg flash_io0_do_core;
reg flash_io0_ieb_core;
reg flash_io0_oeb_core;
wire flash_io1;
wire flash_io1_di_core;
reg flash_io1_do_core;
reg flash_io1_ieb_core;
reg flash_io1_oeb_core;
wire gpio_in_core;
wire gpio_mode0_core;
wire gpio_mode1_core;
wire [`MPRJ_IO_PADS-1:0] mprj_io;
reg [`MPRJ_IO_PADS-1:0] mprj_io_inp_dis;
reg [`MPRJ_IO_PADS-1:0] mprj_io_oeb;
reg [`MPRJ_IO_PADS-1:0] mprj_io_ib_mode_sel;
reg [`MPRJ_IO_PADS-1:0] mprj_io_vtrip_sel;
reg [`MPRJ_IO_PADS-1:0] mprj_io_slow_sel;
reg [`MPRJ_IO_PADS-1:0] mprj_io_holdover;
reg [`MPRJ_IO_PADS-1:0] mprj_io_analog_en;
reg [`MPRJ_IO_PADS-1:0] mprj_io_analog_sel;
reg [`MPRJ_IO_PADS-1:0] mprj_io_analog_pol;
reg [`MPRJ_IO_PADS*3-1:0] mprj_io_dm;
reg [`MPRJ_IO_PADS-1:0] mprj_io_out;
wire [`MPRJ_IO_PADS-1:0] mprj_io_in;
wire [`MPRJ_IO_PADS-10:0] mprj_analog_io;
always #12.5 clock <= (clock === 1'b0);
initial begin
clock = 0;
porb_h = 0;
flash_csb_core = 0;
flash_csb_ieb_core = 1;
flash_csb_oeb_core = 0;
flash_clk_ieb_core = 1;
flash_clk_oeb_core = 0;
mprj_io_ib_mode_sel = {38{1'b0}};
mprj_io_vtrip_sel = {38{1'b0}};
mprj_io_slow_sel = {38{1'b0}};
mprj_io_holdover = {38{1'b0}};
mprj_io_analog_en = {38{1'b0}};
mprj_io_analog_sel = {38{1'b0}};
mprj_io_analog_pol = {38{1'b0}};
end
wire VDD3V3;
wire VDD1V8;
wire VSS;
assign VDD3V3 = power1;
assign VDD1V8 = power2;
assign VSS = 1'b0;
reg power1, power2;
initial begin
RSTB <= 1'b0;
porb_h <= 1'b0;
#500;
porb_h <= 1'b1;
#500;
RSTB <= 1'b1; // Release reset
#2000;
end
initial begin // Power-up sequence
power1 <= 1'b0;
power2 <= 1'b0;
#200;
power1 <= 1'b1;
#200;
power2 <= 1'b1;
end
initial begin
$dumpfile("chip_io.vcd");
$dumpvars(0, chip_io_tb);
#(`SIM_TIME);
$display("%c[1;31m",27);
$display ("Monitor: Timeout, Test Management Protect Failed");
$display("%c[0m",27);
$finish;
end
integer i;
reg [2:0] dm_all;
reg gpio_bit;
assign gpio = gpio_bit;
assign gpio_mode0_core = dm_all[0];
assign gpio_mode1_core = dm_all[1];
reg flash_io0_bit;
reg flash_io1_bit;
assign flash_io0 = flash_io0_bit;
assign flash_io1 = flash_io1_bit;
reg [`MPRJ_IO_PADS-1:0] mprj_io_bits;
assign mprj_io = mprj_io_bits;
initial begin
wait(RSTB == 1'b1); // wait for reset
#25;
// Clock & Reset Pads
if (clock !== clock_core) begin
$display("Error: Clock Pad Test Failed."); $finish;
end
if (RSTB !== rstb_h) begin
$display("Error: Reset Pad Test Failed."); $finish;
end
// Management GPIO Pad
gpio_bit = 1'b1;
gpio_out_core = 1'b0;
gpio_inenb_core = 1'b0;
gpio_outenb_core = 1'b1;
dm_all = 3'b001; // input-only
#25;
if (gpio_in_core !== gpio) begin
$display("Error: GPIO Pad Input Test Failed."); $finish;
end
gpio_bit = 1'bz;
gpio_out_core = 1'b1;
gpio_inenb_core = 1'b1;
gpio_outenb_core = 1'b0;
dm_all = 3'b110; // output-only
#25;
if (gpio_out_core !== gpio) begin
$display("Error: GPIO Pad Output Test Failed."); $finish;
end
// Flash Output Pads
flash_csb_core = 1'b1; // CSB Pad
#25;
if (flash_csb !== flash_csb_core) begin
$display("Error: Flash CSB Pad Test Failed."); $finish;
end
flash_clk_core = 1'b1; // CLK Pad
#25;
if (flash_clk !== flash_clk_core) begin
$display("Error: Flash CLK Pad Test Failed."); $finish;
end
// Flash Inout Pads
flash_io0_bit = 1'b1;
flash_io0_ieb_core = 1'b0; // Input
flash_io0_oeb_core = 1'b1;
#25;
if (flash_io0_di_core !== flash_io0_bit) begin
$display("Error: Flash io0 Pad Input Test Failed."); $finish;
end
flash_io0_bit = 1'bz;
flash_io0_do_core = 1'b1;
flash_io0_ieb_core = 1'b1;
flash_io0_oeb_core = 1'b0; // Output
#25
if (flash_io0 !== flash_io0_do_core) begin
$display("Error: Flash io0 Pad Output Test Failed."); $finish;
end
// User Project Pads - All Outputs
mprj_io_bits = {38{1'bz}};
mprj_io_out = {6'b10101, 32'hF0F0};
mprj_io_oeb = {38{1'b0}};
mprj_io_inp_dis = {38{1'b1}};
mprj_io_dm = {38*3{3'b110}};
#25;
if (mprj_io !== mprj_io_out) begin
$display("Error: User Project Pads Output Test Failed."); $finish;
end
// User Project Pads - All Inputs
mprj_io_bits = {6'b01010, 32'hFF0F};
mprj_io_out = {38{1'b0}};
mprj_io_oeb = {38{1'b1}};
mprj_io_inp_dis = {38{1'b0}};
mprj_io_dm = {38*3{3'b001}};
#25;
if (mprj_io_in !== mprj_io_bits) begin
$display("Error: User Project Pads Input Test Failed."); $finish;
end
// User Project Pads - All Bidirectional
mprj_io_bits = {6'b01010, 32'hF00F}; // drive input signal
mprj_io_out = {38{1'bz}};
mprj_io_oeb = {38{1'b1}};
mprj_io_inp_dis = {38{1'b0}};
mprj_io_dm = {38{3'b110}};
#25;
if (mprj_io_in !== mprj_io_bits) begin
$display("Error: User Project Pads Bidirectional Test Failed."); $finish;
end
mprj_io_bits = {38{1'bz}};
mprj_io_out = {6'b01110, 32'h0FF0}; // drive output signal
mprj_io_oeb = {38{1'b0}};
mprj_io_inp_dis = {38{1'b0}};
mprj_io_dm = {38{3'b110}};
#25;
if (mprj_io !== mprj_io_out) begin
$display("Error: User Project Pads Output Test Failed."); $finish;
end
$display("Success");
$display("Monitor: Chip IO Test Passed.");
#2000;
$finish;
end
assign por_l = ~porb_h;
chip_io uut (
// Package Pins
.vddio (VDD3V3),
.vssio (VSS),
.vdda (VDD3V3),
.vssa (VSS),
.vccd (VDD1V8),
.vssd (VSS),
.vdda1 (VDD3V3),
.vdda2 (VDD3V3),
.vssa1 (VSS),
.vssa2 (VSS),
.vccd1 (VDD1V8),
.vccd2 (VDD1V8),
.vssd1 (VSS),
.vssd2 (VSS),
.gpio(gpio),
.clock(clock),
.resetb(RSTB),
.flash_csb(flash_csb),
.flash_clk(flash_clk),
.flash_io0(flash_io0),
.flash_io1(flash_io1),
// SoC Core Interface
.porb_h(porb_h),
.por(por_l),
.resetb_core_h(rstb_h),
.clock_core(clock_core),
.gpio_out_core(gpio_out_core),
.gpio_in_core(gpio_in_core),
.gpio_mode0_core(gpio_mode0_core),
.gpio_mode1_core(gpio_mode1_core),
.gpio_outenb_core(gpio_outenb_core),
.gpio_inenb_core(gpio_inenb_core),
.flash_csb_core(flash_csb_core),
.flash_clk_core(flash_clk_core),
.flash_csb_oeb_core(flash_csb_oeb_core),
.flash_clk_oeb_core(flash_clk_oeb_core),
.flash_io0_oeb_core(flash_io0_oeb_core),
.flash_io1_oeb_core(flash_io1_oeb_core),
.flash_csb_ieb_core(flash_csb_ieb_core),
.flash_clk_ieb_core(flash_clk_ieb_core),
.flash_io0_ieb_core(flash_io0_ieb_core),
.flash_io1_ieb_core(flash_io1_ieb_core),
.flash_io0_do_core(flash_io0_do_core),
.flash_io1_do_core(flash_io1_do_core),
.flash_io0_di_core(flash_io0_di_core),
.flash_io1_di_core(flash_io1_di_core),
`ifdef SPLIT_BUS
`MPRJ_IO,
`MPRJ_IO_IN,
`MPRJ_IO_OUT,
`MPRJ_IO_OEB,
`MPRJ_IO_INP_DIS,
`MPRJ_IO_IB_MODE_SEL,
`MPRJ_IO_VTRIP_SEL,
`MPRJ_IO_SLOW_SEL,
`MPRJ_IO_HOLDOVER,
`MPRJ_IO_ANALOG_EN,
`MPRJ_IO_ANALOG_SEL,
`MPRJ_IO_ANALOG_POL,
`MPRJ_IO_DM,
`MPRJ_IO_ANALOG
`else
.mprj_io(mprj_io),
.mprj_io_in(mprj_io_in),
.mprj_io_out(mprj_io_out),
.mprj_io_oeb(mprj_io_oeb),
.mprj_io_inp_dis(mprj_io_inp_dis),
.mprj_io_ib_mode_sel(mprj_io_ib_mode_sel),
.mprj_io_vtrip_sel(mprj_io_vtrip_sel),
.mprj_io_slow_sel(mprj_io_slow_sel),
.mprj_io_holdover(mprj_io_holdover),
.mprj_io_analog_en(mprj_io_analog_en),
.mprj_io_analog_sel(mprj_io_analog_sel),
.mprj_io_analog_pol(mprj_io_analog_pol),
.mprj_io_dm(mprj_io_dm),
.mprj_analog_io(mprj_analog_io)
`endif
);
endmodule

View File

@ -0,0 +1,727 @@
// SPDX-FileCopyrightText: 2020 Efabless Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// SPDX-License-Identifier: Apache-2.0
`define MPRJ_IO \
.\mprj_io[0] (mprj_io[0]),\
.\mprj_io[1] (mprj_io[1]),\
.\mprj_io[2] (mprj_io[2]),\
.\mprj_io[3] (mprj_io[3]),\
.\mprj_io[4] (mprj_io[4]),\
.\mprj_io[5] (mprj_io[5]),\
.\mprj_io[6] (mprj_io[6]),\
.\mprj_io[7] (mprj_io[7]),\
.\mprj_io[8] (mprj_io[8]),\
.\mprj_io[9] (mprj_io[9]),\
.\mprj_io[10] (mprj_io[10]),\
.\mprj_io[11] (mprj_io[11]),\
.\mprj_io[12] (mprj_io[12]),\
.\mprj_io[13] (mprj_io[13]),\
.\mprj_io[14] (mprj_io[14]),\
.\mprj_io[15] (mprj_io[15]),\
.\mprj_io[16] (mprj_io[16]),\
.\mprj_io[17] (mprj_io[17]),\
.\mprj_io[18] (mprj_io[18]),\
.\mprj_io[19] (mprj_io[19]),\
.\mprj_io[20] (mprj_io[20]),\
.\mprj_io[21] (mprj_io[21]),\
.\mprj_io[22] (mprj_io[22]),\
.\mprj_io[23] (mprj_io[23]),\
.\mprj_io[24] (mprj_io[24]),\
.\mprj_io[25] (mprj_io[25]),\
.\mprj_io[26] (mprj_io[26]),\
.\mprj_io[27] (mprj_io[27]),\
.\mprj_io[28] (mprj_io[28]),\
.\mprj_io[29] (mprj_io[29]),\
.\mprj_io[30] (mprj_io[30]),\
.\mprj_io[31] (mprj_io[31]),\
.\mprj_io[32] (mprj_io[32]),\
.\mprj_io[33] (mprj_io[33]),\
.\mprj_io[34] (mprj_io[34]),\
.\mprj_io[35] (mprj_io[35]),\
.\mprj_io[36] (mprj_io[36]),\
.\mprj_io[37] (mprj_io[37])
`define MPRJ_IO_IN \
.\mprj_io_in[0] (mprj_io_in[0]),\
.\mprj_io_in[1] (mprj_io_in[1]),\
.\mprj_io_in[2] (mprj_io_in[2]),\
.\mprj_io_in[3] (mprj_io_in[3]),\
.\mprj_io_in[4] (mprj_io_in[4]),\
.\mprj_io_in[5] (mprj_io_in[5]),\
.\mprj_io_in[6] (mprj_io_in[6]),\
.\mprj_io_in[7] (mprj_io_in[7]),\
.\mprj_io_in[8] (mprj_io_in[8]),\
.\mprj_io_in[9] (mprj_io_in[9]),\
.\mprj_io_in[10] (mprj_io_in[10]),\
.\mprj_io_in[11] (mprj_io_in[11]),\
.\mprj_io_in[12] (mprj_io_in[12]),\
.\mprj_io_in[13] (mprj_io_in[13]),\
.\mprj_io_in[14] (mprj_io_in[14]),\
.\mprj_io_in[15] (mprj_io_in[15]),\
.\mprj_io_in[16] (mprj_io_in[16]),\
.\mprj_io_in[17] (mprj_io_in[17]),\
.\mprj_io_in[18] (mprj_io_in[18]),\
.\mprj_io_in[19] (mprj_io_in[19]),\
.\mprj_io_in[20] (mprj_io_in[20]),\
.\mprj_io_in[21] (mprj_io_in[21]),\
.\mprj_io_in[22] (mprj_io_in[22]),\
.\mprj_io_in[23] (mprj_io_in[23]),\
.\mprj_io_in[24] (mprj_io_in[24]),\
.\mprj_io_in[25] (mprj_io_in[25]),\
.\mprj_io_in[26] (mprj_io_in[26]),\
.\mprj_io_in[27] (mprj_io_in[27]),\
.\mprj_io_in[28] (mprj_io_in[28]),\
.\mprj_io_in[29] (mprj_io_in[29]),\
.\mprj_io_in[30] (mprj_io_in[30]),\
.\mprj_io_in[31] (mprj_io_in[31]),\
.\mprj_io_in[32] (mprj_io_in[32]),\
.\mprj_io_in[33] (mprj_io_in[33]),\
.\mprj_io_in[34] (mprj_io_in[34]),\
.\mprj_io_in[35] (mprj_io_in[35]),\
.\mprj_io_in[36] (mprj_io_in[36]),\
.\mprj_io_in[37] (mprj_io_in[37])
`define MPRJ_IO_OUT \
.\mprj_io_out[0] (mprj_io_out[0]),\
.\mprj_io_out[1] (mprj_io_out[1]),\
.\mprj_io_out[2] (mprj_io_out[2]),\
.\mprj_io_out[3] (mprj_io_out[3]),\
.\mprj_io_out[4] (mprj_io_out[4]),\
.\mprj_io_out[5] (mprj_io_out[5]),\
.\mprj_io_out[6] (mprj_io_out[6]),\
.\mprj_io_out[7] (mprj_io_out[7]),\
.\mprj_io_out[8] (mprj_io_out[8]),\
.\mprj_io_out[9] (mprj_io_out[9]),\
.\mprj_io_out[10] (mprj_io_out[10]),\
.\mprj_io_out[11] (mprj_io_out[11]),\
.\mprj_io_out[12] (mprj_io_out[12]),\
.\mprj_io_out[13] (mprj_io_out[13]),\
.\mprj_io_out[14] (mprj_io_out[14]),\
.\mprj_io_out[15] (mprj_io_out[15]),\
.\mprj_io_out[16] (mprj_io_out[16]),\
.\mprj_io_out[17] (mprj_io_out[17]),\
.\mprj_io_out[18] (mprj_io_out[18]),\
.\mprj_io_out[19] (mprj_io_out[19]),\
.\mprj_io_out[20] (mprj_io_out[20]),\
.\mprj_io_out[21] (mprj_io_out[21]),\
.\mprj_io_out[22] (mprj_io_out[22]),\
.\mprj_io_out[23] (mprj_io_out[23]),\
.\mprj_io_out[24] (mprj_io_out[24]),\
.\mprj_io_out[25] (mprj_io_out[25]),\
.\mprj_io_out[26] (mprj_io_out[26]),\
.\mprj_io_out[27] (mprj_io_out[27]),\
.\mprj_io_out[28] (mprj_io_out[28]),\
.\mprj_io_out[29] (mprj_io_out[29]),\
.\mprj_io_out[30] (mprj_io_out[30]),\
.\mprj_io_out[31] (mprj_io_out[31]),\
.\mprj_io_out[32] (mprj_io_out[32]),\
.\mprj_io_out[33] (mprj_io_out[33]),\
.\mprj_io_out[34] (mprj_io_out[34]),\
.\mprj_io_out[35] (mprj_io_out[35]),\
.\mprj_io_out[36] (mprj_io_out[36]),\
.\mprj_io_out[37] (mprj_io_out[37])
`define MPRJ_IO_OEB \
.\mprj_io_oeb[0] (mprj_io_oeb[0]),\
.\mprj_io_oeb[1] (mprj_io_oeb[1]),\
.\mprj_io_oeb[2] (mprj_io_oeb[2]),\
.\mprj_io_oeb[3] (mprj_io_oeb[3]),\
.\mprj_io_oeb[4] (mprj_io_oeb[4]),\
.\mprj_io_oeb[5] (mprj_io_oeb[5]),\
.\mprj_io_oeb[6] (mprj_io_oeb[6]),\
.\mprj_io_oeb[7] (mprj_io_oeb[7]),\
.\mprj_io_oeb[8] (mprj_io_oeb[8]),\
.\mprj_io_oeb[9] (mprj_io_oeb[9]),\
.\mprj_io_oeb[10] (mprj_io_oeb[10]),\
.\mprj_io_oeb[11] (mprj_io_oeb[11]),\
.\mprj_io_oeb[12] (mprj_io_oeb[12]),\
.\mprj_io_oeb[13] (mprj_io_oeb[13]),\
.\mprj_io_oeb[14] (mprj_io_oeb[14]),\
.\mprj_io_oeb[15] (mprj_io_oeb[15]),\
.\mprj_io_oeb[16] (mprj_io_oeb[16]),\
.\mprj_io_oeb[17] (mprj_io_oeb[17]),\
.\mprj_io_oeb[18] (mprj_io_oeb[18]),\
.\mprj_io_oeb[19] (mprj_io_oeb[19]),\
.\mprj_io_oeb[20] (mprj_io_oeb[20]),\
.\mprj_io_oeb[21] (mprj_io_oeb[21]),\
.\mprj_io_oeb[22] (mprj_io_oeb[22]),\
.\mprj_io_oeb[23] (mprj_io_oeb[23]),\
.\mprj_io_oeb[24] (mprj_io_oeb[24]),\
.\mprj_io_oeb[25] (mprj_io_oeb[25]),\
.\mprj_io_oeb[26] (mprj_io_oeb[26]),\
.\mprj_io_oeb[27] (mprj_io_oeb[27]),\
.\mprj_io_oeb[28] (mprj_io_oeb[28]),\
.\mprj_io_oeb[29] (mprj_io_oeb[29]),\
.\mprj_io_oeb[30] (mprj_io_oeb[30]),\
.\mprj_io_oeb[31] (mprj_io_oeb[31]),\
.\mprj_io_oeb[32] (mprj_io_oeb[32]),\
.\mprj_io_oeb[33] (mprj_io_oeb[33]),\
.\mprj_io_oeb[34] (mprj_io_oeb[34]),\
.\mprj_io_oeb[35] (mprj_io_oeb[35]),\
.\mprj_io_oeb[36] (mprj_io_oeb[36]),\
.\mprj_io_oeb[37] (mprj_io_oeb[37])
`define MPRJ_IO_HLDH_N \
.\mprj_io_hldh_n[0] (mprj_io_hldh_n[0]),\
.\mprj_io_hldh_n[1] (mprj_io_hldh_n[1]),\
.\mprj_io_hldh_n[2] (mprj_io_hldh_n[2]),\
.\mprj_io_hldh_n[3] (mprj_io_hldh_n[3]),\
.\mprj_io_hldh_n[4] (mprj_io_hldh_n[4]),\
.\mprj_io_hldh_n[5] (mprj_io_hldh_n[5]),\
.\mprj_io_hldh_n[6] (mprj_io_hldh_n[6]),\
.\mprj_io_hldh_n[7] (mprj_io_hldh_n[7]),\
.\mprj_io_hldh_n[8] (mprj_io_hldh_n[8]),\
.\mprj_io_hldh_n[9] (mprj_io_hldh_n[9]),\
.\mprj_io_hldh_n[10] (mprj_io_hldh_n[10]),\
.\mprj_io_hldh_n[11] (mprj_io_hldh_n[11]),\
.\mprj_io_hldh_n[12] (mprj_io_hldh_n[12]),\
.\mprj_io_hldh_n[13] (mprj_io_hldh_n[13]),\
.\mprj_io_hldh_n[14] (mprj_io_hldh_n[14]),\
.\mprj_io_hldh_n[15] (mprj_io_hldh_n[15]),\
.\mprj_io_hldh_n[16] (mprj_io_hldh_n[16]),\
.\mprj_io_hldh_n[17] (mprj_io_hldh_n[17]),\
.\mprj_io_hldh_n[18] (mprj_io_hldh_n[18]),\
.\mprj_io_hldh_n[19] (mprj_io_hldh_n[19]),\
.\mprj_io_hldh_n[20] (mprj_io_hldh_n[20]),\
.\mprj_io_hldh_n[21] (mprj_io_hldh_n[21]),\
.\mprj_io_hldh_n[22] (mprj_io_hldh_n[22]),\
.\mprj_io_hldh_n[23] (mprj_io_hldh_n[23]),\
.\mprj_io_hldh_n[24] (mprj_io_hldh_n[24]),\
.\mprj_io_hldh_n[25] (mprj_io_hldh_n[25]),\
.\mprj_io_hldh_n[26] (mprj_io_hldh_n[26]),\
.\mprj_io_hldh_n[27] (mprj_io_hldh_n[27]),\
.\mprj_io_hldh_n[28] (mprj_io_hldh_n[28]),\
.\mprj_io_hldh_n[29] (mprj_io_hldh_n[29]),\
.\mprj_io_hldh_n[30] (mprj_io_hldh_n[30]),\
.\mprj_io_hldh_n[31] (mprj_io_hldh_n[31]),\
.\mprj_io_hldh_n[32] (mprj_io_hldh_n[32]),\
.\mprj_io_hldh_n[33] (mprj_io_hldh_n[33]),\
.\mprj_io_hldh_n[34] (mprj_io_hldh_n[34]),\
.\mprj_io_hldh_n[35] (mprj_io_hldh_n[35]),\
.\mprj_io_hldh_n[36] (mprj_io_hldh_n[36]),\
.\mprj_io_hldh_n[37] (mprj_io_hldh_n[37])
`define MPRJ_IO_ENH \
.\mprj_io_enh[0] (mprj_io_enh[0]),\
.\mprj_io_enh[1] (mprj_io_enh[1]),\
.\mprj_io_enh[2] (mprj_io_enh[2]),\
.\mprj_io_enh[3] (mprj_io_enh[3]),\
.\mprj_io_enh[4] (mprj_io_enh[4]),\
.\mprj_io_enh[5] (mprj_io_enh[5]),\
.\mprj_io_enh[6] (mprj_io_enh[6]),\
.\mprj_io_enh[7] (mprj_io_enh[7]),\
.\mprj_io_enh[8] (mprj_io_enh[8]),\
.\mprj_io_enh[9] (mprj_io_enh[9]),\
.\mprj_io_enh[10] (mprj_io_enh[10]),\
.\mprj_io_enh[11] (mprj_io_enh[11]),\
.\mprj_io_enh[12] (mprj_io_enh[12]),\
.\mprj_io_enh[13] (mprj_io_enh[13]),\
.\mprj_io_enh[14] (mprj_io_enh[14]),\
.\mprj_io_enh[15] (mprj_io_enh[15]),\
.\mprj_io_enh[16] (mprj_io_enh[16]),\
.\mprj_io_enh[17] (mprj_io_enh[17]),\
.\mprj_io_enh[18] (mprj_io_enh[18]),\
.\mprj_io_enh[19] (mprj_io_enh[19]),\
.\mprj_io_enh[20] (mprj_io_enh[20]),\
.\mprj_io_enh[21] (mprj_io_enh[21]),\
.\mprj_io_enh[22] (mprj_io_enh[22]),\
.\mprj_io_enh[23] (mprj_io_enh[23]),\
.\mprj_io_enh[24] (mprj_io_enh[24]),\
.\mprj_io_enh[25] (mprj_io_enh[25]),\
.\mprj_io_enh[26] (mprj_io_enh[26]),\
.\mprj_io_enh[27] (mprj_io_enh[27]),\
.\mprj_io_enh[28] (mprj_io_enh[28]),\
.\mprj_io_enh[29] (mprj_io_enh[29]),\
.\mprj_io_enh[30] (mprj_io_enh[30]),\
.\mprj_io_enh[31] (mprj_io_enh[31]),\
.\mprj_io_enh[32] (mprj_io_enh[32]),\
.\mprj_io_enh[33] (mprj_io_enh[33]),\
.\mprj_io_enh[34] (mprj_io_enh[34]),\
.\mprj_io_enh[35] (mprj_io_enh[35]),\
.\mprj_io_enh[36] (mprj_io_enh[36]),\
.\mprj_io_enh[37] (mprj_io_enh[37])
`define MPRJ_IO_INP_DIS \
.\mprj_io_inp_dis[0] (mprj_io_inp_dis[0]),\
.\mprj_io_inp_dis[1] (mprj_io_inp_dis[1]),\
.\mprj_io_inp_dis[2] (mprj_io_inp_dis[2]),\
.\mprj_io_inp_dis[3] (mprj_io_inp_dis[3]),\
.\mprj_io_inp_dis[4] (mprj_io_inp_dis[4]),\
.\mprj_io_inp_dis[5] (mprj_io_inp_dis[5]),\
.\mprj_io_inp_dis[6] (mprj_io_inp_dis[6]),\
.\mprj_io_inp_dis[7] (mprj_io_inp_dis[7]),\
.\mprj_io_inp_dis[8] (mprj_io_inp_dis[8]),\
.\mprj_io_inp_dis[9] (mprj_io_inp_dis[9]),\
.\mprj_io_inp_dis[10] (mprj_io_inp_dis[10]),\
.\mprj_io_inp_dis[11] (mprj_io_inp_dis[11]),\
.\mprj_io_inp_dis[12] (mprj_io_inp_dis[12]),\
.\mprj_io_inp_dis[13] (mprj_io_inp_dis[13]),\
.\mprj_io_inp_dis[14] (mprj_io_inp_dis[14]),\
.\mprj_io_inp_dis[15] (mprj_io_inp_dis[15]),\
.\mprj_io_inp_dis[16] (mprj_io_inp_dis[16]),\
.\mprj_io_inp_dis[17] (mprj_io_inp_dis[17]),\
.\mprj_io_inp_dis[18] (mprj_io_inp_dis[18]),\
.\mprj_io_inp_dis[19] (mprj_io_inp_dis[19]),\
.\mprj_io_inp_dis[20] (mprj_io_inp_dis[20]),\
.\mprj_io_inp_dis[21] (mprj_io_inp_dis[21]),\
.\mprj_io_inp_dis[22] (mprj_io_inp_dis[22]),\
.\mprj_io_inp_dis[23] (mprj_io_inp_dis[23]),\
.\mprj_io_inp_dis[24] (mprj_io_inp_dis[24]),\
.\mprj_io_inp_dis[25] (mprj_io_inp_dis[25]),\
.\mprj_io_inp_dis[26] (mprj_io_inp_dis[26]),\
.\mprj_io_inp_dis[27] (mprj_io_inp_dis[27]),\
.\mprj_io_inp_dis[28] (mprj_io_inp_dis[28]),\
.\mprj_io_inp_dis[29] (mprj_io_inp_dis[29]),\
.\mprj_io_inp_dis[30] (mprj_io_inp_dis[30]),\
.\mprj_io_inp_dis[31] (mprj_io_inp_dis[31]),\
.\mprj_io_inp_dis[32] (mprj_io_inp_dis[32]),\
.\mprj_io_inp_dis[33] (mprj_io_inp_dis[33]),\
.\mprj_io_inp_dis[34] (mprj_io_inp_dis[34]),\
.\mprj_io_inp_dis[35] (mprj_io_inp_dis[35]),\
.\mprj_io_inp_dis[36] (mprj_io_inp_dis[36]),\
.\mprj_io_inp_dis[37] (mprj_io_inp_dis[37])
`define MPRJ_IO_IB_MODE_SEL \
.\mprj_io_ib_mode_sel[0] (mprj_io_ib_mode_sel[0]),\
.\mprj_io_ib_mode_sel[1] (mprj_io_ib_mode_sel[1]),\
.\mprj_io_ib_mode_sel[2] (mprj_io_ib_mode_sel[2]),\
.\mprj_io_ib_mode_sel[3] (mprj_io_ib_mode_sel[3]),\
.\mprj_io_ib_mode_sel[4] (mprj_io_ib_mode_sel[4]),\
.\mprj_io_ib_mode_sel[5] (mprj_io_ib_mode_sel[5]),\
.\mprj_io_ib_mode_sel[6] (mprj_io_ib_mode_sel[6]),\
.\mprj_io_ib_mode_sel[7] (mprj_io_ib_mode_sel[7]),\
.\mprj_io_ib_mode_sel[8] (mprj_io_ib_mode_sel[8]),\
.\mprj_io_ib_mode_sel[9] (mprj_io_ib_mode_sel[9]),\
.\mprj_io_ib_mode_sel[10] (mprj_io_ib_mode_sel[10]),\
.\mprj_io_ib_mode_sel[11] (mprj_io_ib_mode_sel[11]),\
.\mprj_io_ib_mode_sel[12] (mprj_io_ib_mode_sel[12]),\
.\mprj_io_ib_mode_sel[13] (mprj_io_ib_mode_sel[13]),\
.\mprj_io_ib_mode_sel[14] (mprj_io_ib_mode_sel[14]),\
.\mprj_io_ib_mode_sel[15] (mprj_io_ib_mode_sel[15]),\
.\mprj_io_ib_mode_sel[16] (mprj_io_ib_mode_sel[16]),\
.\mprj_io_ib_mode_sel[17] (mprj_io_ib_mode_sel[17]),\
.\mprj_io_ib_mode_sel[18] (mprj_io_ib_mode_sel[18]),\
.\mprj_io_ib_mode_sel[19] (mprj_io_ib_mode_sel[19]),\
.\mprj_io_ib_mode_sel[20] (mprj_io_ib_mode_sel[20]),\
.\mprj_io_ib_mode_sel[21] (mprj_io_ib_mode_sel[21]),\
.\mprj_io_ib_mode_sel[22] (mprj_io_ib_mode_sel[22]),\
.\mprj_io_ib_mode_sel[23] (mprj_io_ib_mode_sel[23]),\
.\mprj_io_ib_mode_sel[24] (mprj_io_ib_mode_sel[24]),\
.\mprj_io_ib_mode_sel[25] (mprj_io_ib_mode_sel[25]),\
.\mprj_io_ib_mode_sel[26] (mprj_io_ib_mode_sel[26]),\
.\mprj_io_ib_mode_sel[27] (mprj_io_ib_mode_sel[27]),\
.\mprj_io_ib_mode_sel[28] (mprj_io_ib_mode_sel[28]),\
.\mprj_io_ib_mode_sel[29] (mprj_io_ib_mode_sel[29]),\
.\mprj_io_ib_mode_sel[30] (mprj_io_ib_mode_sel[30]),\
.\mprj_io_ib_mode_sel[31] (mprj_io_ib_mode_sel[31]),\
.\mprj_io_ib_mode_sel[32] (mprj_io_ib_mode_sel[32]),\
.\mprj_io_ib_mode_sel[33] (mprj_io_ib_mode_sel[33]),\
.\mprj_io_ib_mode_sel[34] (mprj_io_ib_mode_sel[34]),\
.\mprj_io_ib_mode_sel[35] (mprj_io_ib_mode_sel[35]),\
.\mprj_io_ib_mode_sel[36] (mprj_io_ib_mode_sel[36]),\
.\mprj_io_ib_mode_sel[37] (mprj_io_ib_mode_sel[37])
`define MPRJ_IO_VTRIP_SEL \
.\mprj_io_vtrip_sel[0] (mprj_io_vtrip_sel[0]),\
.\mprj_io_vtrip_sel[1] (mprj_io_vtrip_sel[1]),\
.\mprj_io_vtrip_sel[2] (mprj_io_vtrip_sel[2]),\
.\mprj_io_vtrip_sel[3] (mprj_io_vtrip_sel[3]),\
.\mprj_io_vtrip_sel[4] (mprj_io_vtrip_sel[4]),\
.\mprj_io_vtrip_sel[5] (mprj_io_vtrip_sel[5]),\
.\mprj_io_vtrip_sel[6] (mprj_io_vtrip_sel[6]),\
.\mprj_io_vtrip_sel[7] (mprj_io_vtrip_sel[7]),\
.\mprj_io_vtrip_sel[8] (mprj_io_vtrip_sel[8]),\
.\mprj_io_vtrip_sel[9] (mprj_io_vtrip_sel[9]),\
.\mprj_io_vtrip_sel[10] (mprj_io_vtrip_sel[10]),\
.\mprj_io_vtrip_sel[11] (mprj_io_vtrip_sel[11]),\
.\mprj_io_vtrip_sel[12] (mprj_io_vtrip_sel[12]),\
.\mprj_io_vtrip_sel[13] (mprj_io_vtrip_sel[13]),\
.\mprj_io_vtrip_sel[14] (mprj_io_vtrip_sel[14]),\
.\mprj_io_vtrip_sel[15] (mprj_io_vtrip_sel[15]),\
.\mprj_io_vtrip_sel[16] (mprj_io_vtrip_sel[16]),\
.\mprj_io_vtrip_sel[17] (mprj_io_vtrip_sel[17]),\
.\mprj_io_vtrip_sel[18] (mprj_io_vtrip_sel[18]),\
.\mprj_io_vtrip_sel[19] (mprj_io_vtrip_sel[19]),\
.\mprj_io_vtrip_sel[20] (mprj_io_vtrip_sel[20]),\
.\mprj_io_vtrip_sel[21] (mprj_io_vtrip_sel[21]),\
.\mprj_io_vtrip_sel[22] (mprj_io_vtrip_sel[22]),\
.\mprj_io_vtrip_sel[23] (mprj_io_vtrip_sel[23]),\
.\mprj_io_vtrip_sel[24] (mprj_io_vtrip_sel[24]),\
.\mprj_io_vtrip_sel[25] (mprj_io_vtrip_sel[25]),\
.\mprj_io_vtrip_sel[26] (mprj_io_vtrip_sel[26]),\
.\mprj_io_vtrip_sel[27] (mprj_io_vtrip_sel[27]),\
.\mprj_io_vtrip_sel[28] (mprj_io_vtrip_sel[28]),\
.\mprj_io_vtrip_sel[29] (mprj_io_vtrip_sel[29]),\
.\mprj_io_vtrip_sel[30] (mprj_io_vtrip_sel[30]),\
.\mprj_io_vtrip_sel[31] (mprj_io_vtrip_sel[31]),\
.\mprj_io_vtrip_sel[32] (mprj_io_vtrip_sel[32]),\
.\mprj_io_vtrip_sel[33] (mprj_io_vtrip_sel[33]),\
.\mprj_io_vtrip_sel[34] (mprj_io_vtrip_sel[34]),\
.\mprj_io_vtrip_sel[35] (mprj_io_vtrip_sel[35]),\
.\mprj_io_vtrip_sel[36] (mprj_io_vtrip_sel[36]),\
.\mprj_io_vtrip_sel[37] (mprj_io_vtrip_sel[37])
`define MPRJ_IO_SLOW_SEL \
.\mprj_io_slow_sel[0] (mprj_io_slow_sel[0]),\
.\mprj_io_slow_sel[1] (mprj_io_slow_sel[1]),\
.\mprj_io_slow_sel[2] (mprj_io_slow_sel[2]),\
.\mprj_io_slow_sel[3] (mprj_io_slow_sel[3]),\
.\mprj_io_slow_sel[4] (mprj_io_slow_sel[4]),\
.\mprj_io_slow_sel[5] (mprj_io_slow_sel[5]),\
.\mprj_io_slow_sel[6] (mprj_io_slow_sel[6]),\
.\mprj_io_slow_sel[7] (mprj_io_slow_sel[7]),\
.\mprj_io_slow_sel[8] (mprj_io_slow_sel[8]),\
.\mprj_io_slow_sel[9] (mprj_io_slow_sel[9]),\
.\mprj_io_slow_sel[10] (mprj_io_slow_sel[10]),\
.\mprj_io_slow_sel[11] (mprj_io_slow_sel[11]),\
.\mprj_io_slow_sel[12] (mprj_io_slow_sel[12]),\
.\mprj_io_slow_sel[13] (mprj_io_slow_sel[13]),\
.\mprj_io_slow_sel[14] (mprj_io_slow_sel[14]),\
.\mprj_io_slow_sel[15] (mprj_io_slow_sel[15]),\
.\mprj_io_slow_sel[16] (mprj_io_slow_sel[16]),\
.\mprj_io_slow_sel[17] (mprj_io_slow_sel[17]),\
.\mprj_io_slow_sel[18] (mprj_io_slow_sel[18]),\
.\mprj_io_slow_sel[19] (mprj_io_slow_sel[19]),\
.\mprj_io_slow_sel[20] (mprj_io_slow_sel[20]),\
.\mprj_io_slow_sel[21] (mprj_io_slow_sel[21]),\
.\mprj_io_slow_sel[22] (mprj_io_slow_sel[22]),\
.\mprj_io_slow_sel[23] (mprj_io_slow_sel[23]),\
.\mprj_io_slow_sel[24] (mprj_io_slow_sel[24]),\
.\mprj_io_slow_sel[25] (mprj_io_slow_sel[25]),\
.\mprj_io_slow_sel[26] (mprj_io_slow_sel[26]),\
.\mprj_io_slow_sel[27] (mprj_io_slow_sel[27]),\
.\mprj_io_slow_sel[28] (mprj_io_slow_sel[28]),\
.\mprj_io_slow_sel[29] (mprj_io_slow_sel[29]),\
.\mprj_io_slow_sel[30] (mprj_io_slow_sel[30]),\
.\mprj_io_slow_sel[31] (mprj_io_slow_sel[31]),\
.\mprj_io_slow_sel[32] (mprj_io_slow_sel[32]),\
.\mprj_io_slow_sel[33] (mprj_io_slow_sel[33]),\
.\mprj_io_slow_sel[34] (mprj_io_slow_sel[34]),\
.\mprj_io_slow_sel[35] (mprj_io_slow_sel[35]),\
.\mprj_io_slow_sel[36] (mprj_io_slow_sel[36]),\
.\mprj_io_slow_sel[37] (mprj_io_slow_sel[37])
`define MPRJ_IO_HOLDOVER \
.\mprj_io_holdover[0] (mprj_io_holdover[0]),\
.\mprj_io_holdover[1] (mprj_io_holdover[1]),\
.\mprj_io_holdover[2] (mprj_io_holdover[2]),\
.\mprj_io_holdover[3] (mprj_io_holdover[3]),\
.\mprj_io_holdover[4] (mprj_io_holdover[4]),\
.\mprj_io_holdover[5] (mprj_io_holdover[5]),\
.\mprj_io_holdover[6] (mprj_io_holdover[6]),\
.\mprj_io_holdover[7] (mprj_io_holdover[7]),\
.\mprj_io_holdover[8] (mprj_io_holdover[8]),\
.\mprj_io_holdover[9] (mprj_io_holdover[9]),\
.\mprj_io_holdover[10] (mprj_io_holdover[10]),\
.\mprj_io_holdover[11] (mprj_io_holdover[11]),\
.\mprj_io_holdover[12] (mprj_io_holdover[12]),\
.\mprj_io_holdover[13] (mprj_io_holdover[13]),\
.\mprj_io_holdover[14] (mprj_io_holdover[14]),\
.\mprj_io_holdover[15] (mprj_io_holdover[15]),\
.\mprj_io_holdover[16] (mprj_io_holdover[16]),\
.\mprj_io_holdover[17] (mprj_io_holdover[17]),\
.\mprj_io_holdover[18] (mprj_io_holdover[18]),\
.\mprj_io_holdover[19] (mprj_io_holdover[19]),\
.\mprj_io_holdover[20] (mprj_io_holdover[20]),\
.\mprj_io_holdover[21] (mprj_io_holdover[21]),\
.\mprj_io_holdover[22] (mprj_io_holdover[22]),\
.\mprj_io_holdover[23] (mprj_io_holdover[23]),\
.\mprj_io_holdover[24] (mprj_io_holdover[24]),\
.\mprj_io_holdover[25] (mprj_io_holdover[25]),\
.\mprj_io_holdover[26] (mprj_io_holdover[26]),\
.\mprj_io_holdover[27] (mprj_io_holdover[27]),\
.\mprj_io_holdover[28] (mprj_io_holdover[28]),\
.\mprj_io_holdover[29] (mprj_io_holdover[29]),\
.\mprj_io_holdover[30] (mprj_io_holdover[30]),\
.\mprj_io_holdover[31] (mprj_io_holdover[31]),\
.\mprj_io_holdover[32] (mprj_io_holdover[32]),\
.\mprj_io_holdover[33] (mprj_io_holdover[33]),\
.\mprj_io_holdover[34] (mprj_io_holdover[34]),\
.\mprj_io_holdover[35] (mprj_io_holdover[35]),\
.\mprj_io_holdover[36] (mprj_io_holdover[36]),\
.\mprj_io_holdover[37] (mprj_io_holdover[37])
`define MPRJ_IO_ANALOG_EN \
.\mprj_io_analog_en[0] (mprj_io_analog_en[0]),\
.\mprj_io_analog_en[1] (mprj_io_analog_en[1]),\
.\mprj_io_analog_en[2] (mprj_io_analog_en[2]),\
.\mprj_io_analog_en[3] (mprj_io_analog_en[3]),\
.\mprj_io_analog_en[4] (mprj_io_analog_en[4]),\
.\mprj_io_analog_en[5] (mprj_io_analog_en[5]),\
.\mprj_io_analog_en[6] (mprj_io_analog_en[6]),\
.\mprj_io_analog_en[7] (mprj_io_analog_en[7]),\
.\mprj_io_analog_en[8] (mprj_io_analog_en[8]),\
.\mprj_io_analog_en[9] (mprj_io_analog_en[9]),\
.\mprj_io_analog_en[10] (mprj_io_analog_en[10]),\
.\mprj_io_analog_en[11] (mprj_io_analog_en[11]),\
.\mprj_io_analog_en[12] (mprj_io_analog_en[12]),\
.\mprj_io_analog_en[13] (mprj_io_analog_en[13]),\
.\mprj_io_analog_en[14] (mprj_io_analog_en[14]),\
.\mprj_io_analog_en[15] (mprj_io_analog_en[15]),\
.\mprj_io_analog_en[16] (mprj_io_analog_en[16]),\
.\mprj_io_analog_en[17] (mprj_io_analog_en[17]),\
.\mprj_io_analog_en[18] (mprj_io_analog_en[18]),\
.\mprj_io_analog_en[19] (mprj_io_analog_en[19]),\
.\mprj_io_analog_en[20] (mprj_io_analog_en[20]),\
.\mprj_io_analog_en[21] (mprj_io_analog_en[21]),\
.\mprj_io_analog_en[22] (mprj_io_analog_en[22]),\
.\mprj_io_analog_en[23] (mprj_io_analog_en[23]),\
.\mprj_io_analog_en[24] (mprj_io_analog_en[24]),\
.\mprj_io_analog_en[25] (mprj_io_analog_en[25]),\
.\mprj_io_analog_en[26] (mprj_io_analog_en[26]),\
.\mprj_io_analog_en[27] (mprj_io_analog_en[27]),\
.\mprj_io_analog_en[28] (mprj_io_analog_en[28]),\
.\mprj_io_analog_en[29] (mprj_io_analog_en[29]),\
.\mprj_io_analog_en[30] (mprj_io_analog_en[30]),\
.\mprj_io_analog_en[31] (mprj_io_analog_en[31]),\
.\mprj_io_analog_en[32] (mprj_io_analog_en[32]),\
.\mprj_io_analog_en[33] (mprj_io_analog_en[33]),\
.\mprj_io_analog_en[34] (mprj_io_analog_en[34]),\
.\mprj_io_analog_en[35] (mprj_io_analog_en[35]),\
.\mprj_io_analog_en[36] (mprj_io_analog_en[36]),\
.\mprj_io_analog_en[37] (mprj_io_analog_en[37])
`define MPRJ_IO_ANALOG_SEL \
.\mprj_io_analog_sel[0] (mprj_io_analog_sel[0]),\
.\mprj_io_analog_sel[1] (mprj_io_analog_sel[1]),\
.\mprj_io_analog_sel[2] (mprj_io_analog_sel[2]),\
.\mprj_io_analog_sel[3] (mprj_io_analog_sel[3]),\
.\mprj_io_analog_sel[4] (mprj_io_analog_sel[4]),\
.\mprj_io_analog_sel[5] (mprj_io_analog_sel[5]),\
.\mprj_io_analog_sel[6] (mprj_io_analog_sel[6]),\
.\mprj_io_analog_sel[7] (mprj_io_analog_sel[7]),\
.\mprj_io_analog_sel[8] (mprj_io_analog_sel[8]),\
.\mprj_io_analog_sel[9] (mprj_io_analog_sel[9]),\
.\mprj_io_analog_sel[10] (mprj_io_analog_sel[10]),\
.\mprj_io_analog_sel[11] (mprj_io_analog_sel[11]),\
.\mprj_io_analog_sel[12] (mprj_io_analog_sel[12]),\
.\mprj_io_analog_sel[13] (mprj_io_analog_sel[13]),\
.\mprj_io_analog_sel[14] (mprj_io_analog_sel[14]),\
.\mprj_io_analog_sel[15] (mprj_io_analog_sel[15]),\
.\mprj_io_analog_sel[16] (mprj_io_analog_sel[16]),\
.\mprj_io_analog_sel[17] (mprj_io_analog_sel[17]),\
.\mprj_io_analog_sel[18] (mprj_io_analog_sel[18]),\
.\mprj_io_analog_sel[19] (mprj_io_analog_sel[19]),\
.\mprj_io_analog_sel[20] (mprj_io_analog_sel[20]),\
.\mprj_io_analog_sel[21] (mprj_io_analog_sel[21]),\
.\mprj_io_analog_sel[22] (mprj_io_analog_sel[22]),\
.\mprj_io_analog_sel[23] (mprj_io_analog_sel[23]),\
.\mprj_io_analog_sel[24] (mprj_io_analog_sel[24]),\
.\mprj_io_analog_sel[25] (mprj_io_analog_sel[25]),\
.\mprj_io_analog_sel[26] (mprj_io_analog_sel[26]),\
.\mprj_io_analog_sel[27] (mprj_io_analog_sel[27]),\
.\mprj_io_analog_sel[28] (mprj_io_analog_sel[28]),\
.\mprj_io_analog_sel[29] (mprj_io_analog_sel[29]),\
.\mprj_io_analog_sel[30] (mprj_io_analog_sel[30]),\
.\mprj_io_analog_sel[31] (mprj_io_analog_sel[31]),\
.\mprj_io_analog_sel[32] (mprj_io_analog_sel[32]),\
.\mprj_io_analog_sel[33] (mprj_io_analog_sel[33]),\
.\mprj_io_analog_sel[34] (mprj_io_analog_sel[34]),\
.\mprj_io_analog_sel[35] (mprj_io_analog_sel[35]),\
.\mprj_io_analog_sel[36] (mprj_io_analog_sel[36]),\
.\mprj_io_analog_sel[37] (mprj_io_analog_sel[37])
`define MPRJ_IO_ANALOG_POL \
.\mprj_io_analog_pol[0] (mprj_io_analog_pol[0]),\
.\mprj_io_analog_pol[1] (mprj_io_analog_pol[1]),\
.\mprj_io_analog_pol[2] (mprj_io_analog_pol[2]),\
.\mprj_io_analog_pol[3] (mprj_io_analog_pol[3]),\
.\mprj_io_analog_pol[4] (mprj_io_analog_pol[4]),\
.\mprj_io_analog_pol[5] (mprj_io_analog_pol[5]),\
.\mprj_io_analog_pol[6] (mprj_io_analog_pol[6]),\
.\mprj_io_analog_pol[7] (mprj_io_analog_pol[7]),\
.\mprj_io_analog_pol[8] (mprj_io_analog_pol[8]),\
.\mprj_io_analog_pol[9] (mprj_io_analog_pol[9]),\
.\mprj_io_analog_pol[10] (mprj_io_analog_pol[10]),\
.\mprj_io_analog_pol[11] (mprj_io_analog_pol[11]),\
.\mprj_io_analog_pol[12] (mprj_io_analog_pol[12]),\
.\mprj_io_analog_pol[13] (mprj_io_analog_pol[13]),\
.\mprj_io_analog_pol[14] (mprj_io_analog_pol[14]),\
.\mprj_io_analog_pol[15] (mprj_io_analog_pol[15]),\
.\mprj_io_analog_pol[16] (mprj_io_analog_pol[16]),\
.\mprj_io_analog_pol[17] (mprj_io_analog_pol[17]),\
.\mprj_io_analog_pol[18] (mprj_io_analog_pol[18]),\
.\mprj_io_analog_pol[19] (mprj_io_analog_pol[19]),\
.\mprj_io_analog_pol[20] (mprj_io_analog_pol[20]),\
.\mprj_io_analog_pol[21] (mprj_io_analog_pol[21]),\
.\mprj_io_analog_pol[22] (mprj_io_analog_pol[22]),\
.\mprj_io_analog_pol[23] (mprj_io_analog_pol[23]),\
.\mprj_io_analog_pol[24] (mprj_io_analog_pol[24]),\
.\mprj_io_analog_pol[25] (mprj_io_analog_pol[25]),\
.\mprj_io_analog_pol[26] (mprj_io_analog_pol[26]),\
.\mprj_io_analog_pol[27] (mprj_io_analog_pol[27]),\
.\mprj_io_analog_pol[28] (mprj_io_analog_pol[28]),\
.\mprj_io_analog_pol[29] (mprj_io_analog_pol[29]),\
.\mprj_io_analog_pol[30] (mprj_io_analog_pol[30]),\
.\mprj_io_analog_pol[31] (mprj_io_analog_pol[31]),\
.\mprj_io_analog_pol[32] (mprj_io_analog_pol[32]),\
.\mprj_io_analog_pol[33] (mprj_io_analog_pol[33]),\
.\mprj_io_analog_pol[34] (mprj_io_analog_pol[34]),\
.\mprj_io_analog_pol[35] (mprj_io_analog_pol[35]),\
.\mprj_io_analog_pol[36] (mprj_io_analog_pol[36]),\
.\mprj_io_analog_pol[37] (mprj_io_analog_pol[37])
`define MPRJ_IO_DM \
.\mprj_io_dm[0] (mprj_io_dm[0]),\
.\mprj_io_dm[1] (mprj_io_dm[1]),\
.\mprj_io_dm[2] (mprj_io_dm[2]),\
.\mprj_io_dm[3] (mprj_io_dm[3]),\
.\mprj_io_dm[4] (mprj_io_dm[4]),\
.\mprj_io_dm[5] (mprj_io_dm[5]),\
.\mprj_io_dm[6] (mprj_io_dm[6]),\
.\mprj_io_dm[7] (mprj_io_dm[7]),\
.\mprj_io_dm[8] (mprj_io_dm[8]),\
.\mprj_io_dm[9] (mprj_io_dm[9]),\
.\mprj_io_dm[10] (mprj_io_dm[10]),\
.\mprj_io_dm[11] (mprj_io_dm[11]),\
.\mprj_io_dm[12] (mprj_io_dm[12]),\
.\mprj_io_dm[13] (mprj_io_dm[13]),\
.\mprj_io_dm[14] (mprj_io_dm[14]),\
.\mprj_io_dm[15] (mprj_io_dm[15]),\
.\mprj_io_dm[16] (mprj_io_dm[16]),\
.\mprj_io_dm[17] (mprj_io_dm[17]),\
.\mprj_io_dm[18] (mprj_io_dm[18]),\
.\mprj_io_dm[19] (mprj_io_dm[19]),\
.\mprj_io_dm[20] (mprj_io_dm[20]),\
.\mprj_io_dm[21] (mprj_io_dm[21]),\
.\mprj_io_dm[22] (mprj_io_dm[22]),\
.\mprj_io_dm[23] (mprj_io_dm[23]),\
.\mprj_io_dm[24] (mprj_io_dm[24]),\
.\mprj_io_dm[25] (mprj_io_dm[25]),\
.\mprj_io_dm[26] (mprj_io_dm[26]),\
.\mprj_io_dm[27] (mprj_io_dm[27]),\
.\mprj_io_dm[28] (mprj_io_dm[28]),\
.\mprj_io_dm[29] (mprj_io_dm[29]),\
.\mprj_io_dm[30] (mprj_io_dm[30]),\
.\mprj_io_dm[31] (mprj_io_dm[31]),\
.\mprj_io_dm[32] (mprj_io_dm[32]),\
.\mprj_io_dm[33] (mprj_io_dm[33]),\
.\mprj_io_dm[34] (mprj_io_dm[34]),\
.\mprj_io_dm[35] (mprj_io_dm[35]),\
.\mprj_io_dm[36] (mprj_io_dm[36]),\
.\mprj_io_dm[37] (mprj_io_dm[37]),\
.\mprj_io_dm[38] (mprj_io_dm[38]),\
.\mprj_io_dm[39] (mprj_io_dm[39]),\
.\mprj_io_dm[40] (mprj_io_dm[40]),\
.\mprj_io_dm[41] (mprj_io_dm[41]),\
.\mprj_io_dm[42] (mprj_io_dm[42]),\
.\mprj_io_dm[43] (mprj_io_dm[43]),\
.\mprj_io_dm[44] (mprj_io_dm[44]),\
.\mprj_io_dm[45] (mprj_io_dm[45]),\
.\mprj_io_dm[46] (mprj_io_dm[46]),\
.\mprj_io_dm[47] (mprj_io_dm[47]),\
.\mprj_io_dm[48] (mprj_io_dm[48]),\
.\mprj_io_dm[49] (mprj_io_dm[49]),\
.\mprj_io_dm[50] (mprj_io_dm[50]),\
.\mprj_io_dm[51] (mprj_io_dm[51]),\
.\mprj_io_dm[52] (mprj_io_dm[52]),\
.\mprj_io_dm[53] (mprj_io_dm[53]),\
.\mprj_io_dm[54] (mprj_io_dm[54]),\
.\mprj_io_dm[55] (mprj_io_dm[55]),\
.\mprj_io_dm[56] (mprj_io_dm[56]),\
.\mprj_io_dm[57] (mprj_io_dm[57]),\
.\mprj_io_dm[58] (mprj_io_dm[58]),\
.\mprj_io_dm[59] (mprj_io_dm[59]),\
.\mprj_io_dm[60] (mprj_io_dm[60]),\
.\mprj_io_dm[61] (mprj_io_dm[61]),\
.\mprj_io_dm[62] (mprj_io_dm[62]),\
.\mprj_io_dm[63] (mprj_io_dm[63]),\
.\mprj_io_dm[64] (mprj_io_dm[64]),\
.\mprj_io_dm[65] (mprj_io_dm[65]),\
.\mprj_io_dm[66] (mprj_io_dm[66]),\
.\mprj_io_dm[67] (mprj_io_dm[67]),\
.\mprj_io_dm[68] (mprj_io_dm[68]),\
.\mprj_io_dm[69] (mprj_io_dm[69]),\
.\mprj_io_dm[70] (mprj_io_dm[70]),\
.\mprj_io_dm[71] (mprj_io_dm[71]),\
.\mprj_io_dm[72] (mprj_io_dm[72]),\
.\mprj_io_dm[73] (mprj_io_dm[73]),\
.\mprj_io_dm[74] (mprj_io_dm[74]),\
.\mprj_io_dm[75] (mprj_io_dm[75]),\
.\mprj_io_dm[76] (mprj_io_dm[76]),\
.\mprj_io_dm[77] (mprj_io_dm[77]),\
.\mprj_io_dm[78] (mprj_io_dm[78]),\
.\mprj_io_dm[79] (mprj_io_dm[79]),\
.\mprj_io_dm[80] (mprj_io_dm[80]),\
.\mprj_io_dm[81] (mprj_io_dm[81]),\
.\mprj_io_dm[82] (mprj_io_dm[82]),\
.\mprj_io_dm[83] (mprj_io_dm[83]),\
.\mprj_io_dm[84] (mprj_io_dm[84]),\
.\mprj_io_dm[85] (mprj_io_dm[85]),\
.\mprj_io_dm[86] (mprj_io_dm[86]),\
.\mprj_io_dm[87] (mprj_io_dm[87]),\
.\mprj_io_dm[88] (mprj_io_dm[88]),\
.\mprj_io_dm[89] (mprj_io_dm[89]),\
.\mprj_io_dm[90] (mprj_io_dm[90]),\
.\mprj_io_dm[91] (mprj_io_dm[91]),\
.\mprj_io_dm[92] (mprj_io_dm[92]),\
.\mprj_io_dm[93] (mprj_io_dm[93]),\
.\mprj_io_dm[94] (mprj_io_dm[94]),\
.\mprj_io_dm[95] (mprj_io_dm[95]),\
.\mprj_io_dm[96] (mprj_io_dm[96]),\
.\mprj_io_dm[97] (mprj_io_dm[97]),\
.\mprj_io_dm[98] (mprj_io_dm[98]),\
.\mprj_io_dm[99] (mprj_io_dm[99]),\
.\mprj_io_dm[100] (mprj_io_dm[100]),\
.\mprj_io_dm[101] (mprj_io_dm[101]),\
.\mprj_io_dm[102] (mprj_io_dm[102]),\
.\mprj_io_dm[103] (mprj_io_dm[103]),\
.\mprj_io_dm[104] (mprj_io_dm[104]),\
.\mprj_io_dm[105] (mprj_io_dm[105]),\
.\mprj_io_dm[106] (mprj_io_dm[106]),\
.\mprj_io_dm[107] (mprj_io_dm[107]),\
.\mprj_io_dm[108] (mprj_io_dm[108]),\
.\mprj_io_dm[109] (mprj_io_dm[109]),\
.\mprj_io_dm[110] (mprj_io_dm[110]),\
.\mprj_io_dm[111] (mprj_io_dm[111]),\
.\mprj_io_dm[112] (mprj_io_dm[112]),\
.\mprj_io_dm[113] (mprj_io_dm[113])
`define MPRJ_IO_ANALOG \
.\mprj_analog_io[0] (mprj_analog_io[0]),\
.\mprj_analog_io[1] (mprj_analog_io[1]),\
.\mprj_analog_io[2] (mprj_analog_io[2]),\
.\mprj_analog_io[3] (mprj_analog_io[3]),\
.\mprj_analog_io[4] (mprj_analog_io[4]),\
.\mprj_analog_io[5] (mprj_analog_io[5]),\
.\mprj_analog_io[6] (mprj_analog_io[6]),\
.\mprj_analog_io[7] (mprj_analog_io[7]),\
.\mprj_analog_io[8] (mprj_analog_io[8]),\
.\mprj_analog_io[9] (mprj_analog_io[9]),\
.\mprj_analog_io[10] (mprj_analog_io[10]),\
.\mprj_analog_io[11] (mprj_analog_io[11]),\
.\mprj_analog_io[12] (mprj_analog_io[12]),\
.\mprj_analog_io[13] (mprj_analog_io[13]),\
.\mprj_analog_io[14] (mprj_analog_io[14]),\
.\mprj_analog_io[15] (mprj_analog_io[15]),\
.\mprj_analog_io[16] (mprj_analog_io[16]),\
.\mprj_analog_io[17] (mprj_analog_io[17]),\
.\mprj_analog_io[18] (mprj_analog_io[18]),\
.\mprj_analog_io[19] (mprj_analog_io[19]),\
.\mprj_analog_io[20] (mprj_analog_io[20]),\
.\mprj_analog_io[21] (mprj_analog_io[21]),\
.\mprj_analog_io[22] (mprj_analog_io[22]),\
.\mprj_analog_io[23] (mprj_analog_io[23]),\
.\mprj_analog_io[24] (mprj_analog_io[24]),\
.\mprj_analog_io[25] (mprj_analog_io[25]),\
.\mprj_analog_io[26] (mprj_analog_io[26]),\
.\mprj_analog_io[27] (mprj_analog_io[27]),\
.\mprj_analog_io[28] (mprj_analog_io[28]),\
.\mprj_analog_io[29] (mprj_analog_io[29]),\
.\mprj_analog_io[30] (mprj_analog_io[30])

View File

@ -0,0 +1,49 @@
# SPDX-FileCopyrightText: 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
PDK_PATH?=$(PDK_ROOT)/sky130A
VERILOG_PATH = ../../../
RTL_PATH = $(VERILOG_PATH)/rtl
SIM ?= RTL
.SUFFIXES:
PATTERN = mgmt_protect
all: ${PATTERN:=.vcd}
%.vvp: %_tb.v
ifeq ($(SIM),RTL)
iverilog -Ttyp -DFUNCTIONAL -I $(PDK_PATH) -I $(VERILOG_PATH) -I .. -I $(RTL_PATH) \
$< -o $@
else
iverilog -Ttyp -DFUNCTIONAL -DGL -I $(PDK_PATH) -I $(VERILOG_PATH) -I .. -I $(RTL_PATH) \
$< -o $@
endif
%.vcd: %.vvp check-env
vvp $<
check-env:
ifndef PDK_ROOT
$(error PDK_ROOT is undefined, please export it before running make)
endif
clean:
rm -f *.vvp *.vcd
.PHONY: clean all

View File

@ -0,0 +1,263 @@
// SPDX-FileCopyrightText: 2020 Efabless Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// SPDX-License-Identifier: Apache-2.0
`default_nettype none
`timescale 1 ns / 1 ps
`define UNIT_DELAY #1
`define USE_POWER_PINS
`define SIM_TIME 100_000
`include "libs.ref/sky130_fd_sc_hd/verilog/primitives.v"
`include "libs.ref/sky130_fd_sc_hd/verilog/sky130_fd_sc_hd.v"
`include "libs.ref/sky130_fd_sc_hvl/verilog/primitives.v"
`include "libs.ref/sky130_fd_sc_hvl/verilog/sky130_fd_sc_hvl.v"
`include "defines.v"
`ifdef GL
// Assume default net type to be wire because GL netlists don't have the wire definitions
`default_nettype wire
`include "gl/mprj_logic_high.v"
`include "gl/mprj2_logic_high.v"
`include "gl/mgmt_protect.v"
`include "gl/mgmt_protect_hv.v"
`else
`include "mprj_logic_high.v"
`include "mprj2_logic_high.v"
`include "mgmt_protect.v"
`include "mgmt_protect_hv.v"
`endif
module mgmt_protect_tb;
reg caravel_clk;
reg caravel_clk2;
reg caravel_rstn;
reg mprj_cyc_o_core;
reg mprj_stb_o_core;
reg mprj_we_o_core;
reg [31:0] mprj_adr_o_core;
reg [31:0] mprj_dat_o_core;
reg [3:0] mprj_sel_o_core;
wire [127:0] la_data_in_mprj;
reg [127:0] la_data_out_mprj;
reg [127:0] la_oenb_mprj;
reg [127:0] la_iena_mprj;
reg [127:0] la_data_out_core;
wire [127:0] la_data_in_core;
wire [127:0] la_oenb_core;
wire user_clock;
wire user_clock2;
wire user_reset;
wire mprj_cyc_o_user;
wire mprj_stb_o_user;
wire mprj_we_o_user;
wire [3:0] mprj_sel_o_user;
wire [31:0] mprj_adr_o_user;
wire [31:0] mprj_dat_o_user;
wire user1_vcc_powergood;
wire user2_vcc_powergood;
wire user1_vdd_powergood;
wire user2_vdd_powergood;
always #12.5 caravel_clk <= (caravel_clk === 1'b0);
always #12.5 caravel_clk2 <= (caravel_clk2 === 1'b0);
initial begin
caravel_clk = 0;
caravel_clk2 = 0;
caravel_rstn = 0;
mprj_cyc_o_core = 0;
mprj_stb_o_core = 0;
mprj_we_o_core = 0;
mprj_adr_o_core = 0;
mprj_dat_o_core = 0;
mprj_sel_o_core = 0;
la_data_out_mprj = 0;
la_oenb_mprj = 0;
la_data_out_core = 0;
end
reg USER_VDD3V3;
reg USER_VDD1V8;
reg VDD3V3;
reg VDD1V8;
wire VCCD; // Management/Common 1.8V power
wire VSSD; // Common digital ground
wire VCCD1; // User area 1 1.8V power
wire VSSD1; // User area 1 digital ground
wire VCCD2; // User area 2 1.8V power
wire VSSD2; // User area 2 digital ground
wire VDDA1; // User area 1 3.3V power
wire VSSA1; // User area 1 analog ground
wire VDDA2; // User area 2 3.3V power
wire VSSA2; // User area 2 analog ground
assign VCCD = VDD1V8;
assign VSSD = 1'b0;
assign VCCD1 = USER_VDD1V8;
assign VSSD1 = 1'b0;
assign VCCD2 = USER_VDD1V8;
assign VSSD2 = 1'b0;
assign VDDA1 = USER_VDD3V3;
assign VSSA1 = 1'b0;
assign VDDA2 = USER_VDD3V3;
assign VSSA2 = 1'b0;
initial begin // Power-up sequence
VDD1V8 <= 1'b0;
USER_VDD3V3 <= 1'b0;
USER_VDD1V8 <= 1'b0;
#200;
VDD1V8 <= 1'b1;
#200;
USER_VDD3V3 <= 1'b1;
#200;
USER_VDD1V8 <= 1'b1;
end
initial begin
$dumpfile("mgmt_protect.vcd");
$dumpvars(0, mgmt_protect_tb);
#(`SIM_TIME);
$display("%c[1;31m",27);
$display ("Monitor: Timeout, Test Management Protect Failed");
$display("%c[0m",27);
$finish;
end
integer i;
initial begin
caravel_rstn = 1'b1;
mprj_cyc_o_core = 1'b1;
mprj_stb_o_core = 1'b1;
mprj_we_o_core = 1'b1;
mprj_sel_o_core = 4'b1010;
mprj_adr_o_core = 32'hF0F0;
mprj_dat_o_core = 32'h0F0F;
la_data_out_mprj = 128'hFFFF_FFFF_FFFF_FFFF;
la_oenb_mprj = 128'h0000_0000_0000_0000;
la_data_out_core = 128'h0F0F_FFFF_F0F0_FFFF;
la_iena_mprj = 128'hFFFF_FFFF_FFFF_FFFF;
wait(user1_vdd_powergood === 1'b1);
wait(user2_vdd_powergood === 1'b1);
wait(user1_vcc_powergood === 1'b1);
wait(user2_vcc_powergood === 1'b1);
#25;
if (user_reset !== ~caravel_rstn) begin
$display("Monitor: Error on user_reset. "); $finish;
end
if (mprj_cyc_o_user !== mprj_cyc_o_core) begin
$display("Monitor: Error on mprj_cyc_o_user. "); $finish;
end
if (mprj_stb_o_user !== mprj_stb_o_core) begin
$display("Monitor: Error on mprj_stb_o_user. "); $finish;
end
if (mprj_we_o_user !== mprj_we_o_core) begin
$display("Monitor: Error on mprj_we_o_user. "); $finish;
end
if (mprj_sel_o_user !== mprj_sel_o_core) begin
$display("Monitor: Error on mprj_sel_o_user. "); $finish;
end
if (mprj_adr_o_user !== mprj_adr_o_core) begin
$display("Monitor: Error on mprj_adr_o_user. "); $finish;
end
if (la_data_in_core !== la_data_out_mprj) begin
$display("%0h", la_data_in_core);
$display("Monitor: Error on la_data_in_core. "); $finish;
end
if (la_oenb_core !== la_oenb_mprj) begin
$display("Monitor: Error on la_oenb_core. "); $finish;
end
if (la_data_in_mprj !== la_data_out_core) begin
$display("%0h , %0h", la_data_in_mprj, la_data_out_core);
$display("Monitor: Error on la_data_in_mprj. "); $finish;
end
$display ("Success!");
$display ("Monitor: Test Management Protect Passed");
$finish;
end
mgmt_protect uut (
`ifdef USE_POWER_PINS
.vccd(VCCD),
.vssd(VSSD),
.vccd1(VCCD1),
.vssd1(VSSD1),
.vccd2(VCCD2),
.vssd2(VSSD2),
.vdda1(VDDA1),
.vssa1(VSSA1),
.vdda2(VDDA2),
.vssa2(VSSA2),
`endif
.caravel_clk (caravel_clk),
.caravel_clk2(caravel_clk2),
.caravel_rstn(caravel_rstn),
.mprj_cyc_o_core(mprj_cyc_o_core),
.mprj_stb_o_core(mprj_stb_o_core),
.mprj_we_o_core (mprj_we_o_core),
.mprj_sel_o_core(mprj_sel_o_core),
.mprj_adr_o_core(mprj_adr_o_core),
.mprj_dat_o_core(mprj_dat_o_core),
.la_data_out_core(la_data_out_core),
.la_data_in_core (la_data_in_core),
.la_oenb_core(la_oenb_core),
.la_data_in_mprj(la_data_in_mprj),
.la_data_out_mprj(la_data_out_mprj),
.la_oenb_mprj(la_oenb_mprj),
.la_iena_mprj(la_iena_mprj),
.user_clock (user_clock),
.user_clock2(user_clock2),
.user_reset (user_reset),
.mprj_cyc_o_user(mprj_cyc_o_user),
.mprj_stb_o_user(mprj_stb_o_user),
.mprj_we_o_user (mprj_we_o_user),
.mprj_sel_o_user(mprj_sel_o_user),
.mprj_adr_o_user(mprj_adr_o_user),
.mprj_dat_o_user(mprj_dat_o_user),
.user1_vcc_powergood(user1_vcc_powergood),
.user2_vcc_powergood(user2_vcc_powergood),
.user1_vdd_powergood(user1_vdd_powergood),
.user2_vdd_powergood(user2_vdd_powergood)
);
endmodule

View File

@ -0,0 +1,33 @@
# SPDX-FileCopyrightText: 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
.SUFFIXES:
PATTERN = mprj_ctrl
all: ${PATTERN:=.vcd}
%.vvp: %_tb.v
iverilog -I ../../../rtl \
$< -o $@
%.vcd: %.vvp
vvp $<
clean:
rm -f *.vvp *.vcd *.log
.PHONY: clean all

View File

@ -0,0 +1,160 @@
// SPDX-FileCopyrightText: 2020 Efabless Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// SPDX-License-Identifier: Apache-2.0
`default_nettype none
`timescale 1 ns / 1 ps
`include "defines.v"
`include "housekeeping_spi.v"
`include "housekeeping.v"
module mprj_ctrl_tb;
reg wb_clk_i;
reg wb_rst_i;
reg wb_stb_i;
reg wb_cyc_i;
reg wb_we_i;
reg [3:0] wb_sel_i;
reg [31:0] wb_dat_i;
reg [31:0] wb_adr_i;
wire wb_ack_o;
wire [31:0] wb_dat_o;
initial begin
wb_clk_i = 0;
wb_rst_i = 0;
wb_stb_i = 0;
wb_cyc_i = 0;
wb_sel_i = 0;
wb_we_i = 0;
wb_dat_i = 0;
wb_adr_i = 0;
end
always #1 wb_clk_i = ~wb_clk_i;
// Mega Project Control Registers
wire [31:0] mprj_ctrl = uut.GPIO_BASE_ADR | 8'h6a;
wire [31:0] pwr_ctrl = uut.GPIO_BASE_ADR | 8'h6e;
initial begin
$dumpfile("mprj_ctrl_tb.vcd");
$dumpvars(0, mprj_ctrl_tb);
repeat (50) begin
repeat (1000) @(posedge wb_clk_i);
end
$display("%c[1;31m",27);
$display ("Monitor: Timeout, Test Mega-Project Control Failed");
$display("%c[0m",27);
$finish;
end
integer i;
reg [31:0] data;
initial begin
// Reset Operation
wb_rst_i = 1;
#2;
wb_rst_i = 0;
#2;
for (i=0; i<`MPRJ_IO_PADS; i=i+1) begin
data = $urandom_range(0, 2**(7));
write(mprj_ctrl+i*4, data);
#2;
read(mprj_ctrl+i*4);
if (wb_dat_o !== data) begin
$display("Monitor: R/W from IO-CTRL Failed.");
$finish;
end
end
data = $urandom_range(0, 2**(`MPRJ_PWR_PADS-2));
write(pwr_ctrl, data);
#2;
read(pwr_ctrl);
if (wb_dat_o !== data) begin
$display("Monitor: R/W from POWER-CTRL Failed.");
$finish;
end
$display("Success!");
$display ("Monitor: Test Mega-Project Control Passed");
$finish;
end
task write;
input [32:0] addr;
input [32:0] data;
begin
@(posedge wb_clk_i) begin
wb_stb_i = 1;
wb_cyc_i = 1;
wb_sel_i = 4'hF;
wb_we_i = 1;
wb_adr_i = addr;
wb_dat_i = data;
$display("Write Cycle Started.");
end
// Wait for an ACK
wait(wb_ack_o == 1);
wait(wb_ack_o == 0);
wb_cyc_i = 0;
wb_stb_i = 0;
$display("Write Cycle Ended.");
end
endtask
task read;
input [32:0] addr;
begin
@(posedge wb_clk_i) begin
wb_stb_i = 1;
wb_cyc_i = 1;
wb_we_i = 0;
wb_adr_i = addr;
$display("Read Cycle Started.");
end
// Wait for an ACK
wait(wb_ack_o == 1);
wait(wb_ack_o == 0);
wb_cyc_i = 0;
wb_stb_i = 0;
$display("Read Cycle Ended.");
end
endtask
housekeeping uut(
.wb_clk_i(wb_clk_i),
.wb_rst_i(wb_rst_i),
.wb_stb_i(wb_stb_i),
.wb_cyc_i(wb_cyc_i),
.wb_sel_i(wb_sel_i),
.wb_we_i(wb_we_i),
.wb_dat_i(wb_dat_i),
.wb_adr_i(wb_adr_i),
.wb_ack_o(wb_ack_o),
.wb_dat_o(wb_dat_o)
);
endmodule

View File

@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
.SUFFIXES:
PATTERN = sysctrl_wb
all: ${PATTERN:=.vcd}
%.vvp: %_tb.v
iverilog -I ../../../rtl \
$< -o $@
%.vcd: %.vvp
vvp $<
clean:
rm -f *.vvp *.vcd *.log
.PHONY: clean all

View File

@ -0,0 +1,173 @@
// SPDX-FileCopyrightText: 2020 Efabless Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// SPDX-License-Identifier: Apache-2.0
`default_nettype none
`timescale 1 ns / 1 ps
`include "defines.v"
`include "housekeeping_spi.v"
`include "housekeeping.v"
module sysctrl_wb_tb;
reg wb_clk_i;
reg wb_rst_i;
reg wb_stb_i;
reg wb_cyc_i;
reg wb_we_i;
reg [3:0] wb_sel_i;
reg [31:0] wb_dat_i;
reg [31:0] wb_adr_i;
wire wb_ack_o;
wire [31:0] wb_dat_o;
initial begin
wb_clk_i = 0;
wb_rst_i = 0;
wb_stb_i = 0;
wb_cyc_i = 0;
wb_sel_i = 0;
wb_we_i = 0;
wb_dat_i = 0;
wb_adr_i = 0;
end
always #1 wb_clk_i = ~wb_clk_i;
initial begin
$dumpfile("sysctrl_wb_tb.vcd");
$dumpvars(0, sysctrl_wb_tb);
repeat (50) begin
repeat (1000) @(posedge wb_clk_i);
end
$display("%c[1;31m",27);
$display ("Monitor: Timeout, Test System Control Failed");
$display("%c[0m",27);
$finish;
end
integer i;
// System Control Default Register Addresses
wire [31:0] clk_out_adr = uut.SYS_BASE_ADR | 8'h1b;
wire [31:0] trap_out_adr = uut.SYS_BASE_ADR | 8'h1b;
wire [31:0] irq_src_adr = uut.SYS_BASE_ADR | 8'h1c;
reg clk1_output_dest;
reg clk2_output_dest;
reg trap_output_dest;
reg irq_7_inputsrc;
reg irq_8_inputsrc;
initial begin
// Reset Operation
wb_rst_i = 1;
#2;
wb_rst_i = 0;
#2;
clk1_output_dest = 1'b1;
clk2_output_dest = 1'b1;
trap_output_dest = 1'b1;
irq_7_inputsrc = 1'b1;
irq_8_inputsrc = 1'b1;
// Write to System Control Registers
write(clk_out_adr, clk1_output_dest);
write(trap_out_adr, trap_output_dest);
write(irq_src_adr, irq_7_inputsrc);
#2;
read(clk_out_adr);
if (wb_dat_o !== clk1_output_dest) begin
$display("Error reading CLK1 output destination register.");
$finish;
end
read(trap_out_adr);
if (wb_dat_o !== trap_output_dest) begin
$display("Error reading trap output destination register.");
$finish;
end
read(irq_src_adr);
if (wb_dat_o !== irq_7_inputsrc) begin
$display("Error reading IRQ7 input source register.");
$finish;
end
$display("Success!");
$display ("Monitor: Test System Control Passed!");
$finish;
end
task write;
input [32:0] addr;
input [32:0] data;
begin
@(posedge wb_clk_i) begin
wb_stb_i = 1;
wb_cyc_i = 1;
wb_sel_i = 4'hF;
wb_we_i = 1;
wb_adr_i = addr;
wb_dat_i = data;
$display("Monitor: Write Cycle Started.");
end
// Wait for an ACK
wait(wb_ack_o == 1);
wait(wb_ack_o == 0);
wb_cyc_i = 0;
wb_stb_i = 0;
$display("Monitor: Write Cycle Ended.");
end
endtask
task read;
input [32:0] addr;
begin
@(posedge wb_clk_i) begin
wb_stb_i = 1;
wb_cyc_i = 1;
wb_we_i = 0;
wb_adr_i = addr;
$display("Monitor: Read Cycle Started.");
end
// Wait for an ACK
wait(wb_ack_o == 1);
wait(wb_ack_o == 0);
wb_cyc_i = 0;
wb_stb_i = 0;
$display("Monitor: Read Cycle Ended.");
end
endtask
housekeeping uut(
.wb_clk_i(wb_clk_i),
.wb_rst_i(wb_rst_i),
.wb_stb_i(wb_stb_i),
.wb_cyc_i(wb_cyc_i),
.wb_sel_i(wb_sel_i),
.wb_we_i(wb_we_i),
.wb_dat_i(wb_dat_i),
.wb_adr_i(wb_adr_i),
.wb_ack_o(wb_ack_o),
.wb_dat_o(wb_dat_o)
);
endmodule