update adi_library to vivado 2024.1

compile adi_library with latest hdl commit and vivado 2024.1
This commit is contained in:
2024-06-06 11:22:50 +08:00
parent 3c6c573f6a
commit 24cc6b9ee9
695 changed files with 17906 additions and 9982 deletions
@@ -0,0 +1,31 @@
####################################################################################
## Copyright (c) 2018 - 2024 Analog Devices, Inc.
### SPDX short identifier: BSD-1-Clause
## Auto-generated, do not modify!
####################################################################################
LIBRARY_NAME := i3c_controller_core
GENERIC_DEPS += i3c_controller_bit_mod.v
GENERIC_DEPS += i3c_controller_bit_mod.vh
GENERIC_DEPS += i3c_controller_core.v
GENERIC_DEPS += i3c_controller_framing.v
GENERIC_DEPS += i3c_controller_word.v
GENERIC_DEPS += i3c_controller_word.vh
XILINX_DEPS += i3c_controller_core_ip.tcl
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_cmdp.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_cmdp_rtl.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_rmap.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_rmap_rtl.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_rtl.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_sdio.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_sdio_rtl.xml
XILINX_INTERFACE_DEPS += i3c_controller/interfaces
INTEL_DEPS += i3c_controller_core_hw.tcl
include ../../scripts/library.mk
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,247 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
/**
* Modulates the SDA and SCL lanes.
* SCL high time is fixed at 40ns in I3C mode:
* * 4 clock cycles at 100MHz clk.
* * 2 clock cycles at 50MHz clk.
* Parameter CLK_MOD tunes the number of clock cycles to module one lane bus bit,
* to achieve 12.5MHz at the maximum speed grade, set:
* * CLK_MOD = 0, clk = 100MHz
* * CLK_MOD = 1, clk = 50MHz
*/
`timescale 1ns/100ps
`include "i3c_controller_bit_mod.vh"
module i3c_controller_bit_mod #(
parameter CLK_MOD = 0
) (
input reset_n,
input clk,
// Bit Modulation Command
input [`MOD_BIT_CMD_WIDTH:0] cmdb,
input cmdb_valid,
output cmdb_ready,
// Mux to alternative logic to support I²C devices.
input i2c_mode,
// Indicates that the bus is not transferring,
// is *not* bus available condition because does not wait 1s after P.
output nop,
// 0: 1.56MHz
// 1: 3.12MHz
// 2: 6.25MHz
// 3: 12.50MHz
input [1:0] scl_pp_sg, // SCL push-pull speed grade.
output reg rx,
output rx_valid,
// Bus drive signals
output scl,
output reg sdo,
input sdi,
output reg t
);
localparam [1:0] SM_SETUP = 0;
localparam [1:0] SM_STALL = 1;
localparam [1:0] SM_SCL_LOW = 2;
localparam [1:0] SM_SCL_HIGH = 3;
localparam COUNT_INCR = CLK_MOD ? 2 : 1;
reg [`MOD_BIT_CMD_WIDTH:0] cmdb_r;
reg [1:0] pp_sg;
reg [5:0] count; // Worst-case: 1.56MHz, 32-bits per half-bit.
reg sr;
reg i2c_mode_reg;
reg i2c_scl_reg;
reg [3:0] count_delay;
reg [1:0] sm;
wire [`MOD_BIT_CMD_WIDTH:2] st;
wire [1:CLK_MOD] count_high;
wire [3:0] scl_posedge_multi;
wire t_w;
wire t_w2;
wire sdo_w;
wire scl_posedge;
wire sr_sda;
wire sr_scl;
wire i3c_scl_posedge;
wire i2c_scl;
wire i2c_scl_posedge;
wire [1:0] ss;
always @(posedge clk) begin
count <= 4;
i2c_scl_reg <= i2c_scl;
count_delay <= {count_delay[2:0], count[5]};
if (!reset_n) begin
sm <= SM_SETUP;
cmdb_r <= {`MOD_BIT_CMD_NOP_, 2'b01};
pp_sg <= 2'b00;
sr <= 1'b0;
i2c_mode_reg <= 1'b0;
end else begin
if (sm == SM_SETUP & cmdb_valid) begin
i2c_mode_reg <= i2c_mode;
end
case (sm)
SM_SCL_LOW: begin
if (scl_posedge) begin
sm <= SM_SCL_HIGH;
end
end
SM_SCL_HIGH: begin
if (&count_high) begin
if (st == `MOD_BIT_CMD_STOP_) begin
sm <= SM_SETUP;
end else begin
sm <= SM_STALL;
end
end
end
SM_SETUP: begin
sr <= 1'b0;
end
SM_STALL: begin
end
endcase
if (cmdb_ready) begin
if (cmdb_valid) begin
cmdb_r <= cmdb[4:2] != `MOD_BIT_CMD_START_ ? cmdb : {cmdb[4:2], 1'b0, cmdb[0]};
// CMDW_MSG_RX is push-pull, but the Sr to stop from the controller side is open drain.
pp_sg <= cmdb[1] & cmdb[4:2] != `MOD_BIT_CMD_START_ ? scl_pp_sg : 2'b00;
sm <= SM_SCL_LOW;
end else begin
cmdb_r <= {`MOD_BIT_CMD_NOP_, 2'b01};
end
end
if (!cmdb_ready) begin
count <= count + COUNT_INCR;
end
if (sm == SM_SETUP) begin
sr <= 1'b0;
end else if (cmdb_ready) begin
sr <= 1'b1;
end
end
end
generate if (CLK_MOD) begin
// Is short on one clock cycle at clk 50MHz, scl 12.5MHz,
// but due to the lower clk frequency, timing slack to propagate is better.
always @(*) begin
rx = sdi === 1'b0 ? 1'b0 : 1'b1;
end
end else begin
always @(posedge clk) begin
rx <= sdi === 1'b0 ? 1'b0 : 1'b1;
end
end
endgenerate
always @(posedge clk) begin
// To guarantee thd_pp > 3ns.
sdo <= sdo_w;
t <= t_w2;
end
genvar i;
generate
for (i = 0; i < 4; i = i+1) begin: gen_scl
assign scl_posedge_multi[i] = &count[i+2:CLK_MOD];
end
endgenerate
assign scl_posedge = scl_posedge_multi[3-pp_sg];
assign count_high = count[1:CLK_MOD];
assign cmdb_ready = (sm == SM_SETUP) ||
(sm == SM_STALL) ||
(sm == SM_SCL_HIGH & &count_high);
assign ss = cmdb_r[1:0];
assign st = cmdb_r[`MOD_BIT_CMD_WIDTH:2];
// Used to generate Sr with generous timing (locked in open drain speed).
assign sr_sda = ((~count[4] & count[5]) | ~count[5]) & sm == SM_SCL_LOW;
assign sr_scl = count[5] | sm == SM_SCL_HIGH;
assign i2c_scl = count_delay[3];
assign i2c_scl_posedge = i2c_scl & ~i2c_scl_reg;
assign i3c_scl_posedge = (sm == SM_SCL_HIGH & &(~count_high));
// Multi-cycle-path worst-case:
// * 4 clks (12.5MHz, half-bit ack, 100MHz clk)
// * 2 clks (12.5MHz, half-bit ack, 50MHz clk)
assign rx_valid = i2c_mode_reg ? i2c_scl_posedge :
CLK_MOD ? scl_posedge : i3c_scl_posedge;
assign sdo_w = st == `MOD_BIT_CMD_START_ ? sr_sda :
st == `MOD_BIT_CMD_STOP_ ? 1'b0 :
st == `MOD_BIT_CMD_WRITE_ ? ss[0] :
st == `MOD_BIT_CMD_ACK_SDR_ ?
(i2c_mode_reg ? 1'b1 : (sm == SM_SCL_HIGH ? rx : 1'b1)) :
st == `MOD_BIT_CMD_ACK_IBI_ ?
(sm == SM_SCL_HIGH ? 1'b1 : 1'b0) :
1'b1;
// Expression ...
//assign t_w = st == `MOD_BIT_CMD_STOP_ ? 1'b0 :
// st == `MOD_BIT_CMD_START_ ? 1'b0 :
// st == `MOD_BIT_CMD_READ_ ? 1'b0 :
// st == `MOD_BIT_CMD_ACK_SDR_ ? 1'b0 :
// ss[1];
// ... gets optimized to
assign t_w = st[4] ? 1'b0 : ss[1];
assign t_w2 = ~t_w & sdo_w ? 1'b1 : 1'b0;
assign scl = st == `MOD_BIT_CMD_START_ ? (sr ? sr_scl : 1'b1) :
i2c_mode_reg ? (i2c_scl || sm == SM_SETUP) :
(~(sm == SM_SCL_LOW || sm == SM_STALL));
assign nop = st == `MOD_BIT_CMD_NOP_ & sm == SM_SETUP;
endmodule
@@ -0,0 +1,74 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`ifndef BIT_MOD_CMD_V
`define BIT_MOD_CMD_V
`define MOD_BIT_CMD_WIDTH 4
`define MOD_BIT_CMD_NOP_ 3'b000
`define MOD_BIT_CMD_WRITE_ 3'b001
`define MOD_BIT_CMD_ACK_IBI_ 3'b010
`define MOD_BIT_CMD_START_ 3'b100
`define MOD_BIT_CMD_STOP_ 3'b101
`define MOD_BIT_CMD_ACK_SDR_ 3'b110
`define MOD_BIT_CMD_READ_ 3'b111
// Stop, read, ack_sdr have PP variants to preserve the PP
// speed-grade, but the they never active drive SDA High.
// T-bit for read:
// To continue, yield ACK_SDR:
// Read RX to check if the peripheral wishes to continue.
// To stop, yield Start, creating a Sr.
// ACK IBI bit:
// To ACK, yield ACK_IBI.
// to NACK, yield WRITE_OD_1
`define MOD_BIT_CMD_NOP {`MOD_BIT_CMD_NOP_, 2'b00}
`define MOD_BIT_CMD_START_OD {`MOD_BIT_CMD_START_, 2'b00}
`define MOD_BIT_CMD_STOP_OD {`MOD_BIT_CMD_STOP_, 2'b00}
`define MOD_BIT_CMD_STOP_PP {`MOD_BIT_CMD_STOP_, 2'b10}
`define MOD_BIT_CMD_WRITE_OD_0 {`MOD_BIT_CMD_WRITE_, 2'b00}
`define MOD_BIT_CMD_WRITE_OD_1 {`MOD_BIT_CMD_WRITE_, 2'b01}
`define MOD_BIT_CMD_WRITE_PP_0 {`MOD_BIT_CMD_WRITE_, 2'b10}
`define MOD_BIT_CMD_WRITE_PP_1 {`MOD_BIT_CMD_WRITE_, 2'b11}
`define MOD_BIT_CMD_READ_OD {`MOD_BIT_CMD_READ_, 2'b00}
`define MOD_BIT_CMD_READ_PP {`MOD_BIT_CMD_READ_, 2'b10}
`define MOD_BIT_CMD_ACK_SDR_OD {`MOD_BIT_CMD_ACK_SDR_,2'b00}
`define MOD_BIT_CMD_ACK_SDR_PP {`MOD_BIT_CMD_ACK_SDR_,2'b10}
`define MOD_BIT_CMD_ACK_IBI {`MOD_BIT_CMD_ACK_IBI_,2'b00}
`endif
@@ -0,0 +1,194 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`timescale 1ns/100ps
`include "i3c_controller_bit_mod.vh"
`include "i3c_controller_word.vh"
module i3c_controller_core #(
parameter MAX_DEVS = 16,
parameter CLK_MOD = 0
) (
input clk,
input reset_n,
// Command parsed
output cmdp_ready,
input cmdp_valid,
input [30:0] cmdp,
output [2:0] cmdp_error,
output cmdp_nop,
output cmdp_daa_trigger,
// Byte stream
output sdo_ready,
input sdo_valid,
input [7:0] sdo,
input sdi_ready,
output sdi_valid,
output sdi_last,
output [7:0] sdi,
input ibi_ready,
output ibi_valid,
output [14:0] ibi,
// uP accessible info
input [1:0] rmap_ibi_config,
input [1:0] rmap_pp_sg,
output [6:0] rmap_dev_char_addr,
input [3:0] rmap_dev_char_data,
// I3C bus signals
output i3c_scl,
output i3c_sdo,
input i3c_sdi,
output i3c_t
);
wire [`MOD_BIT_CMD_WIDTH:0] cmdb;
wire cmdb_valid;
wire cmdb_ready;
wire rx;
wire rx_valid;
wire cmdw_valid;
wire cmdw_ready;
wire [`CMDW_HEADER_WIDTH+8:0] cmdw;
wire cmdw_nack_bcast;
wire cmdw_nack_resp;
wire arbitration_valid;
wire ibi_bcr_2;
wire ibi_dev_is_attached;
wire ibi_requested;
wire ibi_requested_auto;
wire ibi_tick;
wire [6:0] ibi_da;
wire [7:0] ibi_mdb;
wire nop;
wire i2c_mode;
i3c_controller_framing #(
.MAX_DEVS(MAX_DEVS),
.CLK_MOD(CLK_MOD)
) i_i3c_controller_framing (
.reset_n(reset_n),
.clk(clk),
.cmdp_valid(cmdp_valid),
.cmdp_ready(cmdp_ready),
.cmdp(cmdp),
.cmdp_error(cmdp_error),
.cmdp_daa_trigger(cmdp_daa_trigger),
.sdo_ready(sdo_ready),
.sdo_valid(sdo_valid),
.sdo(sdo),
.cmdw_valid(cmdw_valid),
.cmdw_ready(cmdw_ready),
.cmdw(cmdw),
.cmdw_nack_bcast(cmdw_nack_bcast),
.cmdw_nack_resp(cmdw_nack_resp),
.rx(rx),
.i2c_mode(i2c_mode),
.nop(nop),
.arbitration_valid(arbitration_valid),
.ibi_dev_is_attached(ibi_dev_is_attached),
.ibi_bcr_2(ibi_bcr_2),
.ibi_requested(ibi_requested),
.ibi_requested_auto(ibi_requested_auto),
.ibi_da(ibi_da),
.rmap_ibi_config(rmap_ibi_config),
.rmap_dev_char_addr(rmap_dev_char_addr),
.rmap_dev_char_data(rmap_dev_char_data));
i3c_controller_word
i_i3c_controller_word (
.reset_n(reset_n),
.clk(clk),
.cmdw_valid(cmdw_valid),
.cmdw_ready(cmdw_ready),
.cmdw(cmdw),
.cmdw_nack_bcast(cmdw_nack_bcast),
.cmdw_nack_resp(cmdw_nack_resp),
.sdi_ready(sdi_ready),
.sdi_valid(sdi_valid),
.sdi_last(sdi_last),
.sdi(sdi),
.cmdb(cmdb),
.cmdb_valid(cmdb_valid),
.cmdb_ready(cmdb_ready),
.rx(rx),
.rx_valid(rx_valid),
.arbitration_valid(arbitration_valid),
.ibi_dev_is_attached(ibi_dev_is_attached),
.ibi_bcr_2(ibi_bcr_2),
.ibi_requested(ibi_requested),
.ibi_requested_auto(ibi_requested_auto),
.ibi_tick(ibi_tick),
.ibi_da(ibi_da),
.ibi_mdb(ibi_mdb),
.rmap_ibi_config(rmap_ibi_config));
i3c_controller_bit_mod #(
.CLK_MOD(CLK_MOD)
) i_i3c_controller_bit_mod (
.reset_n(reset_n),
.clk(clk),
.cmdb(cmdb),
.cmdb_valid(cmdb_valid),
.cmdb_ready(cmdb_ready),
.scl_pp_sg(rmap_pp_sg),
.rx(rx),
.rx_valid(rx_valid),
.i2c_mode(i2c_mode),
.nop(nop),
.scl(i3c_scl),
.sdo(i3c_sdo),
.sdi(i3c_sdi),
.t(i3c_t));
assign ibi = {ibi_da, ibi_mdb};
assign ibi_valid = ibi_tick;
assign cmdp_nop = nop;
endmodule
@@ -0,0 +1,433 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Product Version: Vivado v2024.1 (64-bit) -->
<!-- -->
<!-- Copyright 1986-2022 Xilinx, Inc. All Rights Reserved. -->
<!-- Copyright 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved. -->
<Project Product="Vivado" Version="7" Minor="67" Path="/home/josh/Downloads/hdl/library/i3c_controller/i3c_controller_core/i3c_controller_core.xpr">
<DefaultLaunch Dir="$PRUNDIR"/>
<Configuration>
<Option Name="Id" Val="c2471e5d230446fa93830095451f0fc5"/>
<Option Name="Part" Val="xc7vx485tffg1157-1"/>
<Option Name="CompiledLibDir" Val="$PCACHEDIR/compile_simlib"/>
<Option Name="CompiledLibDirXSim" Val=""/>
<Option Name="CompiledLibDirModelSim" Val="$PCACHEDIR/compile_simlib/modelsim"/>
<Option Name="CompiledLibDirQuesta" Val="$PCACHEDIR/compile_simlib/questa"/>
<Option Name="CompiledLibDirXcelium" Val="$PCACHEDIR/compile_simlib/xcelium"/>
<Option Name="CompiledLibDirVCS" Val="$PCACHEDIR/compile_simlib/vcs"/>
<Option Name="CompiledLibDirRiviera" Val="$PCACHEDIR/compile_simlib/riviera"/>
<Option Name="CompiledLibDirActivehdl" Val="$PCACHEDIR/compile_simlib/activehdl"/>
<Option Name="SimulatorInstallDirModelSim" Val=""/>
<Option Name="SimulatorInstallDirQuesta" Val=""/>
<Option Name="SimulatorInstallDirXcelium" Val=""/>
<Option Name="SimulatorInstallDirVCS" Val=""/>
<Option Name="SimulatorInstallDirRiviera" Val=""/>
<Option Name="SimulatorInstallDirActiveHdl" Val=""/>
<Option Name="SimulatorGccInstallDirModelSim" Val=""/>
<Option Name="SimulatorGccInstallDirQuesta" Val=""/>
<Option Name="SimulatorGccInstallDirXcelium" Val=""/>
<Option Name="SimulatorGccInstallDirVCS" Val=""/>
<Option Name="SimulatorGccInstallDirRiviera" Val=""/>
<Option Name="SimulatorGccInstallDirActiveHdl" Val=""/>
<Option Name="SimulatorVersionXsim" Val="2024.1"/>
<Option Name="SimulatorVersionModelSim" Val="2023.2"/>
<Option Name="SimulatorVersionQuesta" Val="2023.2"/>
<Option Name="SimulatorVersionXcelium" Val="23.03.002"/>
<Option Name="SimulatorVersionVCS" Val="U-2023.03-1"/>
<Option Name="SimulatorVersionRiviera" Val="2023.04"/>
<Option Name="SimulatorVersionActiveHdl" Val="14.1"/>
<Option Name="SimulatorGccVersionXsim" Val="9.3.0"/>
<Option Name="SimulatorGccVersionModelSim" Val="7.4.0"/>
<Option Name="SimulatorGccVersionQuesta" Val="7.4.0"/>
<Option Name="SimulatorGccVersionXcelium" Val="9.3.0"/>
<Option Name="SimulatorGccVersionVCS" Val="9.2.0"/>
<Option Name="SimulatorGccVersionRiviera" Val="9.3.0"/>
<Option Name="SimulatorGccVersionActiveHdl" Val="9.3.0"/>
<Option Name="BoardPart" Val=""/>
<Option Name="ActiveSimSet" Val="sim_1"/>
<Option Name="DefaultLib" Val="xil_defaultlib"/>
<Option Name="ProjectType" Val="Default"/>
<Option Name="IPRepoPath" Val="$PPRDIR/../../../library"/>
<Option Name="IPOutputRepo" Val="$PCACHEDIR/ip"/>
<Option Name="IPDefaultOutputPath" Val="$PGENDIR/sources_1"/>
<Option Name="IPCachePermission" Val="read"/>
<Option Name="IPCachePermission" Val="write"/>
<Option Name="EnableCoreContainer" Val="FALSE"/>
<Option Name="EnableResourceEstimation" Val="FALSE"/>
<Option Name="SimCompileState" Val="TRUE"/>
<Option Name="CreateRefXciForCoreContainers" Val="FALSE"/>
<Option Name="IPUserFilesDir" Val="$PIPUSERFILESDIR"/>
<Option Name="IPStaticSourceDir" Val="$PIPUSERFILESDIR/ipstatic"/>
<Option Name="EnableBDX" Val="FALSE"/>
<Option Name="WTXSimLaunchSim" Val="0"/>
<Option Name="WTModelSimLaunchSim" Val="0"/>
<Option Name="WTQuestaLaunchSim" Val="0"/>
<Option Name="WTIesLaunchSim" Val="0"/>
<Option Name="WTVcsLaunchSim" Val="0"/>
<Option Name="WTRivieraLaunchSim" Val="0"/>
<Option Name="WTActivehdlLaunchSim" Val="0"/>
<Option Name="WTXSimExportSim" Val="0"/>
<Option Name="WTModelSimExportSim" Val="0"/>
<Option Name="WTQuestaExportSim" Val="0"/>
<Option Name="WTIesExportSim" Val="0"/>
<Option Name="WTVcsExportSim" Val="0"/>
<Option Name="WTRivieraExportSim" Val="0"/>
<Option Name="WTActivehdlExportSim" Val="0"/>
<Option Name="GenerateIPUpgradeLog" Val="TRUE"/>
<Option Name="XSimRadix" Val="hex"/>
<Option Name="XSimTimeUnit" Val="ns"/>
<Option Name="XSimArrayDisplayLimit" Val="1024"/>
<Option Name="XSimTraceLimit" Val="65536"/>
<Option Name="SimTypes" Val="rtl"/>
<Option Name="SimTypes" Val="bfm"/>
<Option Name="SimTypes" Val="tlm"/>
<Option Name="SimTypes" Val="tlm_dpi"/>
<Option Name="MEMEnableMemoryMapGeneration" Val="TRUE"/>
<Option Name="DcpsUptoDate" Val="TRUE"/>
<Option Name="ClassicSocBoot" Val="FALSE"/>
<Option Name="LocalIPRepoLeafDirName" Val="ip_repo"/>
</Configuration>
<FileSets Version="1" Minor="32">
<FileSet Name="sources_1" Type="DesignSrcs" RelSrcDir="$PSRCDIR/sources_1" RelGenDir="$PGENDIR/sources_1">
<Filter Type="Srcs"/>
<File Path="$PPRDIR/i3c_controller_bit_mod.vh">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="simulation"/>
<Attr Name="IsVisible" Val="1"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_bit_mod.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_word.vh">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="simulation"/>
<Attr Name="IsVisible" Val="1"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_framing.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_word.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_core.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/component.xml">
<FileInfo SFType="IPXACT"/>
</File>
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopModule" Val="i3c_controller_core"/>
</Config>
</FileSet>
<FileSet Name="constrs_1" Type="Constrs" RelSrcDir="$PSRCDIR/constrs_1" RelGenDir="$PGENDIR/constrs_1">
<Filter Type="Constrs"/>
<Config>
<Option Name="ConstrsType" Val="XDC"/>
</Config>
</FileSet>
<FileSet Name="sim_1" Type="SimulationSrcs" RelSrcDir="$PSRCDIR/sim_1" RelGenDir="$PGENDIR/sim_1">
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopAutoSet" Val="TRUE"/>
<Option Name="TransportPathDelay" Val="0"/>
<Option Name="TransportIntDelay" Val="0"/>
<Option Name="SelectedSimModel" Val="rtl"/>
<Option Name="PamDesignTestbench" Val=""/>
<Option Name="PamDutBypassFile" Val="xil_dut_bypass"/>
<Option Name="PamSignalDriverFile" Val="xil_bypass_driver"/>
<Option Name="PamPseudoTop" Val="pseudo_tb"/>
<Option Name="SrcSet" Val="sources_1"/>
</Config>
</FileSet>
<FileSet Name="utils_1" Type="Utils" RelSrcDir="$PSRCDIR/utils_1" RelGenDir="$PGENDIR/utils_1">
<Filter Type="Utils"/>
<Config>
<Option Name="TopAutoSet" Val="TRUE"/>
</Config>
</FileSet>
</FileSets>
<Simulators>
<Simulator Name="XSim">
<Option Name="Description" Val="Vivado Simulator"/>
<Option Name="CompiledLib" Val="0"/>
</Simulator>
<Simulator Name="ModelSim">
<Option Name="Description" Val="ModelSim Simulator"/>
</Simulator>
<Simulator Name="Questa">
<Option Name="Description" Val="Questa Advanced Simulator"/>
</Simulator>
<Simulator Name="Xcelium">
<Option Name="Description" Val="Xcelium Parallel Simulator"/>
</Simulator>
<Simulator Name="VCS">
<Option Name="Description" Val="Verilog Compiler Simulator (VCS)"/>
</Simulator>
<Simulator Name="Riviera">
<Option Name="Description" Val="Riviera-PRO Simulator"/>
</Simulator>
</Simulators>
<Runs Version="1" Minor="22">
<Run Id="synth_1" Type="Ft3:Synth" SrcSet="sources_1" Part="xc7vx485tffg1157-1" ConstrsSet="constrs_1" Description="Vivado Synthesis Defaults" AutoIncrementalCheckpoint="true" WriteIncrSynthDcp="false" State="current" IncludeInArchive="true" IsChild="false" AutoIncrementalDir="$PSRCDIR/utils_1/imports/synth_1" AutoRQSDir="$PSRCDIR/utils_1/imports/synth_1" ParallelReportGen="true">
<Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Synthesis Defaults" Flow="Vivado Synthesis 2024">
<Desc>Vivado Synthesis Defaults</Desc>
</StratHandle>
<Step Id="synth_design"/>
</Strategy>
<ReportStrategy Name="Vivado Synthesis Default Reports" Flow="Vivado Synthesis 2024"/>
<Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
<RQSFiles/>
</Run>
<Run Id="impl_1" Type="Ft2:EntireDesign" Part="xc7vx485tffg1157-1" ConstrsSet="constrs_1" Description="Default settings for Implementation." AutoIncrementalCheckpoint="false" WriteIncrSynthDcp="false" State="current" SynthRun="synth_1" IncludeInArchive="true" IsChild="false" GenFullBitstream="true" AutoIncrementalDir="$PSRCDIR/utils_1/imports/impl_1" AutoRQSDir="$PSRCDIR/utils_1/imports/impl_1" ParallelReportGen="true">
<Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Implementation Defaults" Flow="Vivado Implementation 2024">
<Desc>Default settings for Implementation.</Desc>
</StratHandle>
<Step Id="init_design"/>
<Step Id="opt_design"/>
<Step Id="power_opt_design"/>
<Step Id="place_design"/>
<Step Id="post_place_power_opt_design"/>
<Step Id="phys_opt_design"/>
<Step Id="route_design"/>
<Step Id="post_route_phys_opt_design"/>
<Step Id="write_bitstream"/>
</Strategy>
<ReportStrategy Name="Vivado Implementation Default Reports" Flow="Vivado Implementation 2024"/>
<Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
<RQSFiles/>
</Run>
</Runs>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="Vivado 12-1790"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="1"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="Evaluation"/>
<MsgAttr Name="StringsToMatch" Val="features"/>
<MsgAttr Name="StringsToMatch" Val="should"/>
<MsgAttr Name="StringsToMatch" Val="NOT"/>
<MsgAttr Name="StringsToMatch" Val="be"/>
<MsgAttr Name="StringsToMatch" Val="used"/>
<MsgAttr Name="StringsToMatch" Val="in"/>
<MsgAttr Name="StringsToMatch" Val="production"/>
<MsgAttr Name="StringsToMatch" Val="systems."/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="Designutils 20-3303"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="10"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="HDPYFinalizeIO"/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="Place 30-73"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="11"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="axi_spi"/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val=""/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="12"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="PCW_UIPARAM_DDR_DQS_TO_CLK_DELAY"/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="BD 41-1343"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="2"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="BD 41-1306"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="3"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="ERROR"/>
<MsgAttr Name="Id" Val="BD 41-1276"/>
<MsgAttr Name="Severity" Val="CRITICAL WARNING"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="4"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="IP_Flow 19-3656"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="5"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="IP_Flow 19-4623"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="6"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="IP_Flow 19-459"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="7"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="Synth 8-3331"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="8"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="Synth 8-2490"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="9"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<Board/>
<DashboardSummary Version="1" Minor="0">
<Dashboards>
<Dashboard Name="default_dashboard">
<Gadgets>
<Gadget Name="drc_1" Type="drc" Version="1" Row="2" Column="0">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_drc_0 "/>
</Gadget>
<Gadget Name="methodology_1" Type="methodology" Version="1" Row="2" Column="1">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_methodology_0 "/>
</Gadget>
<Gadget Name="power_1" Type="power" Version="1" Row="1" Column="0">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_power_0 "/>
</Gadget>
<Gadget Name="timing_1" Type="timing" Version="1" Row="0" Column="1">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_timing_summary_0 "/>
</Gadget>
<Gadget Name="utilization_1" Type="utilization" Version="1" Row="0" Column="0">
<GadgetParam Name="REPORTS" Type="string_list" Value="synth_1#synth_1_synth_report_utilization_0 "/>
<GadgetParam Name="RUN.STEP" Type="string" Value="synth_design"/>
<GadgetParam Name="RUN.TYPE" Type="string" Value="synthesis"/>
</Gadget>
<Gadget Name="utilization_2" Type="utilization" Version="1" Row="1" Column="1">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_place_report_utilization_0 "/>
</Gadget>
</Gadgets>
</Dashboard>
<CurrentDashboard>default_dashboard</CurrentDashboard>
</Dashboards>
</DashboardSummary>
</Project>
@@ -0,0 +1,93 @@
###############################################################################
## Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################
package require qsys 14.0
source ../../../scripts/adi_env.tcl
source ../../scripts/adi_ip_intel.tcl
ad_ip_create i3c_controller_core {I3C Controller Core} p_elaboration
set_module_property ELABORATION_CALLBACK p_elaboration
ad_ip_files i3c_controller_core [list \
i3c_controller_core.v \
i3c_controller_framing.v \
i3c_controller_word.v \
i3c_controller_word.vh \
i3c_controller_bit_mod.v \
i3c_controller_bit_mod.vh \
]
# parameters
ad_ip_parameter MAX_DEVS STRING "MAX_DEVS"
ad_ip_parameter CLK_MOD INTEGER 1
proc p_elaboration {} {
# read parameters
set max_devs [get_parameter_value "MAX_DEVS"]
set clk_mod [get_parameter_value "CLK_MOD"]
# clock and reset interface
ad_interface clock clk input 1
ad_interface reset reset_n input 1 if_clk
add_interface sdo axi4stream end
add_interface_port sdo sdo_ready tready output 1
add_interface_port sdo sdo_valid tvalid input 1
add_interface_port sdo sdo tdata input 8
set_interface_property sdo associatedClock if_clk
set_interface_property sdo associatedReset if_reset_n
add_interface sdi axi4stream start
add_interface_port sdi sdi_ready tready input 1
add_interface_port sdi sdi_valid tvalid output 1
add_interface_port sdi sdi_last tlast output 1
add_interface_port sdi sdi tdata output 8
set_interface_property sdi associatedClock if_clk
set_interface_property sdi associatedReset if_reset_n
add_interface ibi axi4stream start
add_interface_port ibi ibi_ready tready input 1
add_interface_port ibi ibi_valid tvalid output 1
add_interface_port ibi ibi tdata output 15
set_interface_property ibi associatedClock if_clk
set_interface_property ibi associatedReset if_reset_n
add_interface cmdp conduit end
add_interface_port cmdp cmdp_ready cready output 1
add_interface_port cmdp cmdp_valid cvalid input 1
add_interface_port cmdp cmdp cdata input 31
add_interface_port cmdp cmdp_error error output 3
add_interface_port cmdp cmdp_nop nop output 1
add_interface_port cmdp cmdp_daa_trigger daa_trigger output 1
set_interface_property cmdp associatedClock if_clk
set_interface_property cmdp associatedReset if_reset_n
add_interface rmap conduit end
add_interface_port rmap rmap_ibi_config ibi_config input 2
add_interface_port rmap rmap_pp_sg pp_sg input 2
add_interface_port rmap rmap_dev_char_addr dev_char_addr output 7
add_interface_port rmap rmap_dev_char_data dev_char_data input 4
set_interface_property rmap associatedClock if_clk
set_interface_property rmap associatedReset if_reset_n
# physical I3C interface
add_interface i3c conduit end
add_interface_port i3c i3c_scl scl output 1
add_interface_port i3c i3c_sdo sdo output 1
add_interface_port i3c i3c_sdi sdi input 1
add_interface_port i3c i3c_t t output 1
set_interface_property i3c associatedClock if_clk
set_interface_property i3c associatedReset if_reset_n
}
@@ -0,0 +1,126 @@
###############################################################################
## Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################
source ../../../scripts/adi_env.tcl
source $ad_hdl_dir/library/scripts/adi_ip_xilinx.tcl
global VIVADO_IP_LIBRARY
adi_ip_create i3c_controller_core
adi_ip_files i3c_controller_core [list \
"i3c_controller_core.v" \
"i3c_controller_framing.v" \
"i3c_controller_word.v" \
"i3c_controller_word.vh" \
"i3c_controller_bit_mod.v" \
"i3c_controller_bit_mod.vh" \
]
adi_ip_properties_lite i3c_controller_core
set_property company_url {https://wiki.analog.com/resources/fpga/peripherals/i3c_controller/core} [ipx::current_core]
# Remove all inferred interfaces
ipx::remove_all_bus_interface [ipx::current_core]
## Interface definitions
adi_add_bus "i3c" "master" \
"analog.com:interface:i3c_controller_rtl:1.0" \
"analog.com:interface:i3c_controller:1.0" \
{
{"i3c_scl" "scl"} \
{"i3c_sdo" "sdo"} \
{"i3c_sdi" "sdi"} \
{"i3c_t" "t"} \
}
adi_add_bus_clock "clk" "i3c" "reset_n"
adi_add_bus "sdio" "slave" \
"analog.com:interface:i3c_controller_sdio_rtl:1.0" \
"analog.com:interface:i3c_controller_sdio:1.0" \
{
{"sdo_ready" "sdo_ready"} \
{"sdo_valid" "sdo_valid"} \
{"sdo" "sdo"} \
{"sdi_ready" "sdi_ready"} \
{"sdi_valid" "sdi_valid"} \
{"sdi_last" "sdi_last"} \
{"sdi" "sdi"} \
{"ibi_ready" "ibi_ready"} \
{"ibi_valid" "ibi_valid"} \
{"ibi" "ibi"} \
}
adi_add_bus_clock "clk" "sdio" "reset_n"
adi_add_bus "cmdp" "slave" \
"analog.com:interface:i3c_controller_cmdp_rtl:1.0" \
"analog.com:interface:i3c_controller_cmdp:1.0" \
{
{"cmdp_valid" "cmdp_valid"} \
{"cmdp_ready" "cmdp_ready"} \
{"cmdp" "cmdp"} \
{"cmdp_error" "cmdp_error"} \
{"cmdp_nop" "cmdp_nop"} \
{"cmdp_daa_trigger" "cmdp_daa_trigger"} \
}
adi_add_bus_clock "clk" "cmdp" "reset_n"
adi_add_bus "rmap" "slave" \
"analog.com:interface:i3c_controller_rmap_rtl:1.0" \
"analog.com:interface:i3c_controller_rmap:1.0" \
{
{"rmap_ibi_config" "rmap_ibi_config"} \
{"rmap_pp_sg" "rmap_pp_sg"} \
{"rmap_dev_char_addr" "rmap_dev_char_addr"} \
{"rmap_dev_char_data" "rmap_dev_char_data"} \
}
adi_add_bus_clock "clk" "rmap" "reset_n" "master"
set cc [ipx::current_core]
## MAX_DEVS
set_property -dict [list \
"value_validation_type" "range_long" \
"value_validation_range_minimum" "1" \
"value_validation_range_maximum" "16" \
] \
[ipx::get_user_parameters MAX_DEVS -of_objects $cc]
## CLK_MOD
set_property -dict [list \
"value_validation_type" "pairs" \
"value_validation_pairs" {"8" 0 "4" 1} \
] \
[ipx::get_user_parameters CLK_MOD -of_objects $cc]
## Customize IP Layout
## Remove the automatically generated GUI page
ipgui::remove_page -component $cc [ipgui::get_pagespec -name "Page 0" -component $cc]
ipx::save_core [ipx::current_core]
## Create general configuration page
ipgui::add_page -name {I3C Controller Core} -component [ipx::current_core] -display_name {AXI I3C Controller Core}
set page0 [ipgui::get_pagespec -name "I3C Controller Core" -component $cc]
set general_group [ipgui::add_group -name "General Configuration" -component $cc \
-parent $page0 -display_name "General Configuration" ]
ipgui::add_param -name "MAX_DEVS" -component $cc -parent $general_group
set_property -dict [list \
"display_name" "Maximum number of peripherals" \
"tooltip" "\[MAX_DEVS\] Maximum number of peripherals in the bus, counting the controller" \
] [ipgui::get_guiparamspec -name "MAX_DEVS" -component $cc]
ipgui::add_param -name "CLK_MOD" -component $cc -parent $general_group
set_property -dict [list \
"widget" "comboBox" \
"display_name" "Clock cycles per bit" \
"tooltip" "\[CLK_MOD\] Adjust clock cycles required to modulate the lane bus bits. Set 8 to achieve 12.5MHz at 100Mhz input clock, and 4 at 50MHz." \
] [ipgui::get_guiparamspec -name "CLK_MOD" -component $cc]
## Create and save the XGUI file
ipx::create_xgui_files $cc
ipx::save_core $cc
@@ -0,0 +1,430 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
/**
* Frames commands to the word module.
* That means, joins cmdp and sdio bus into single interface cmdw.
* It is the main state-machine for the Command Descriptors received.
*
* The Dynamic Address Assigment (DAA) procedure is:
* Controller | Peripheral | Flow
* -----------------|-------------|---------
* S,0x7e,RnW=0 | | │
* | ACK | │
* ENTDAA,T | | │
* Sr | | ┌─►│
* 0x7e,RnW=1 | | │ ▼
* | ACK | │ A──┐
* | PID+BCR+DCR | │ │ │
* DA, Par | | │ ▼ │
* | ACK | └──B │
* P | | C◄─┘
*
* Notes
* From A with ACK, continue flow to B, or with NACK, goto C Stop,
* finishing the DAA. At B, goto on st state before A, Sr.
* The first and last ACK are mandatory in the flowchart, if a NACK is received,
* it is considered an error and the module resets.
* The whole DAA occurs in OD, hence the Start as Sr in the SM below.
*/
`timescale 1ns/100ps
`include "i3c_controller_word.vh"
module i3c_controller_framing #(
parameter MAX_DEVS = 16,
parameter CLK_MOD = 0
) (
input clk,
input reset_n,
// Command parsed
output cmdp_ready,
input cmdp_valid,
input [30:0] cmdp,
output [2:0] cmdp_error,
output reg cmdp_daa_trigger,
// Byte stream
output sdo_ready,
input sdo_valid,
input [7:0] sdo,
// Word command
output [`CMDW_HEADER_WIDTH+8:0] cmdw,
output cmdw_valid,
input cmdw_ready,
input cmdw_nack_bcast,
input cmdw_nack_resp,
// Raw SDO input
input rx,
input nop,
output reg i2c_mode,
// IBI interface
input arbitration_valid,
output ibi_dev_is_attached,
output ibi_bcr_2,
input ibi_requested,
output reg ibi_requested_auto,
input [6:0] ibi_da,
// uP accessible info
input [1:0] rmap_ibi_config,
output [6:0] rmap_dev_char_addr,
input [3:0] rmap_dev_char_data
);
// Defines the bus available condition width (> 1us for target)
// Setting around 0.64us for the controller.
localparam BUS_AVAIL = CLK_MOD ? 4 : 5;
localparam [2:0] SM_SETUP = 0;
localparam [2:0] SM_VALIDATE = 1;
localparam [2:0] SM_TRANSFER = 2;
localparam [2:0] SM_SETUP_SDO = 3;
localparam [2:0] SM_CLEANUP = 4;
localparam [2:0] SM_ARBITRATION = 5;
localparam [6:0] CCC_ENTDAA = 'h07;
reg [`CMDW_HEADER_WIDTH:0] st;
reg [BUS_AVAIL:0] bus_avail_reg;
reg cmdp_ccc_reg;
reg cmdp_ccc_bcast_reg;
reg [6:0] cmdp_ccc_id_reg;
reg cmdp_bcast_header_reg;
reg cmdp_sr_reg;
reg [11:0] cmdp_buffer_len_reg;
reg [6:0] cmdp_da_reg;
reg cmdp_rnw_reg;
reg cmdp_valid_reg;
reg [7:0] cmdw_body;
reg ctrl_daa;
reg ctrl_validate;
reg [3:0] j;
reg [2:0] dev_char_len;
reg daa_trigger;
reg error_nack_bcast;
reg error_unknown_da;
reg error_nack_resp ;
reg [2:0] sm;
wire bus_avail;
wire ibi_enable;
wire ibi_listen;
wire cmdp_rnw;
wire [6:0] cmdp_da;
wire [11:0] cmdp_buffer_len;
wire cmdp_sr;
wire cmdp_bcast_header;
wire cmdp_ccc;
wire [6:0] cmdp_ccc_id;
wire cmdp_ccc_bcast;
wire dev_is_attached;
wire dev_is_i2c;
always @(posedge clk) begin
error_unknown_da <= 1'b0;
if (!reset_n) begin
j <= 0;
st <= `CMDW_NOP;
sm <= SM_SETUP;
ctrl_daa <= 1'b0;
ibi_requested_auto <= 1'b0;
cmdp_sr_reg <= 0;
daa_trigger <= 1'b0;
i2c_mode <= 1'b0;
end else if (cmdw_nack_bcast | cmdw_nack_resp) begin
j <= 0;
st <= `CMDW_NOP;
sm <= cmdp_ccc_id_reg == CCC_ENTDAA ? SM_SETUP :
cmdp_rnw_reg ? SM_SETUP : SM_CLEANUP;
ctrl_daa <= 1'b0;
end else begin
// Delay DAA trigger one word to match last SDI byte.
cmdp_daa_trigger <= 1'b0;
if (cmdw_ready) begin
daa_trigger <= 1'b0;
cmdp_daa_trigger <= daa_trigger;
end
// SDI Ready is are not checked, data will be lost
// if it do not accept/provide data when needed.
case (sm)
SM_SETUP: begin
j <= 0;
i2c_mode <= 1'b0;
// Condition where a peripheral requested a IBI during quiet times.
if (cmdp_valid) begin
cmdp_sr_reg <= cmdp_sr;
// Look last SM_TRANSFER SR flag.
st <= cmdp_sr_reg ? `CMDW_MSG_SR : `CMDW_START;
// CCC Broadcast casts to all devices, validation not required.
// Direct is CCC_BCAST 1'b1
sm <= cmdp_ccc & ~cmdp_ccc_bcast ? SM_TRANSFER : SM_VALIDATE;
ctrl_validate <= 1'b0;
end else if (ibi_listen & rx === 1'b0 & bus_avail) begin
st <= `CMDW_BCAST_7E_W0;
sm <= SM_TRANSFER;
ibi_requested_auto <= 1'b1;
end
cmdp_valid_reg <= cmdp_valid;
cmdp_ccc_reg <= cmdp_ccc;
cmdp_ccc_bcast_reg <= cmdp_ccc_bcast;
cmdp_ccc_id_reg <= cmdp_ccc_id;
cmdp_bcast_header_reg <= cmdp_bcast_header;
cmdp_buffer_len_reg <= cmdp_buffer_len;
cmdp_da_reg <= cmdp_da;
cmdp_rnw_reg <= cmdp_rnw;
end
SM_VALIDATE: begin
// Provide one clock cycle to read the BRAM and improve timing.
ctrl_validate <= 1'b1;
if (ctrl_validate) begin
if (dev_is_i2c) begin
i2c_mode <= 1'b1;
end else begin
i2c_mode <= 1'b0;
end
if (dev_is_attached) begin
sm <= SM_TRANSFER;
end else begin
error_unknown_da <= 1'b1;
sm <= cmdp_rnw_reg ? SM_SETUP : SM_CLEANUP;
end
end
end
SM_TRANSFER: begin
if (cmdw_ready) begin
ibi_requested_auto <= 1'b0;
case(st)
`CMDW_NOP: begin
sm <= SM_SETUP;
ctrl_daa <= 1'b0;
end
`CMDW_SR,
`CMDW_START: begin
cmdw_body <= {cmdp_da, cmdp_rnw}; // Attention to RnW here
st <= ctrl_daa ? `CMDW_BCAST_7E_W1 :
(~cmdp_bcast_header_reg & ~cmdp_ccc_reg) | dev_is_i2c ? `CMDW_TARGET_ADDR_OD :
`CMDW_BCAST_7E_W0;
end
`CMDW_BCAST_7E_W0: begin
sm <= SM_ARBITRATION;
cmdw_body <= {cmdp_ccc_bcast_reg, cmdp_ccc_id_reg}; // Attention to BCAST here
end
`CMDW_CCC_OD: begin
// Occurs only during the DAA
st <= `CMDW_START;
ctrl_daa <= 1'b1;
end
`CMDW_CCC_PP: begin
if (cmdp_ccc_bcast_reg) begin
st <= `CMDW_MSG_SR;
end else if (~|cmdp_buffer_len_reg) begin
st <= `CMDW_STOP_PP;
if (cmdp_sr_reg) begin
sm <= SM_SETUP;
end
end else begin
st <= `CMDW_MSG_TX;
sm <= SM_SETUP_SDO;
cmdp_buffer_len_reg <= cmdp_buffer_len_reg - 1;
end
end
`CMDW_BCAST_7E_W1: begin
// Occurs only during the DAA
dev_char_len <= 7;
st <= `CMDW_DAA_DEV_CHAR;
end
`CMDW_DAA_DEV_CHAR: begin
dev_char_len <= dev_char_len - 1;
if (~|dev_char_len) begin
st <= `CMDW_DYN_ADDR;
sm <= SM_SETUP_SDO;
daa_trigger <= 1'b1;
end
end
`CMDW_DYN_ADDR: begin
st <= j == MAX_DEVS - 1 ? `CMDW_STOP_OD : `CMDW_START;
end
`CMDW_MSG_SR: begin
cmdw_body <= {cmdp_da, cmdp_rnw}; // Be aware of RnW here
st <= dev_is_i2c ? `CMDW_TARGET_ADDR_OD : `CMDW_TARGET_ADDR_PP;
end
`CMDW_TARGET_ADDR_OD,
`CMDW_TARGET_ADDR_PP: begin
if (cmdp_rnw_reg) begin
st <= dev_is_i2c ? `CMDW_I2C_RX : `CMDW_MSG_RX;
end else begin
st <= dev_is_i2c ? `CMDW_I2C_TX : `CMDW_MSG_TX;
sm <= SM_SETUP_SDO;
end
cmdp_buffer_len_reg <= cmdp_buffer_len_reg - 1;
end
`CMDW_I2C_RX,
`CMDW_MSG_RX: begin
// I²C read transfers cannot be stopped by the peripheral.
cmdp_buffer_len_reg <= cmdp_buffer_len_reg - 1;
if (~|cmdp_buffer_len_reg) begin
st <= dev_is_i2c ? `CMDW_STOP_OD :`CMDW_STOP_PP;
if (cmdp_sr_reg) begin
sm <= SM_SETUP;
end
end
end
`CMDW_I2C_TX,
`CMDW_MSG_TX: begin
cmdp_buffer_len_reg <= cmdp_buffer_len_reg - 1;
if (~|cmdp_buffer_len_reg) begin
st <= dev_is_i2c ? `CMDW_STOP_OD :`CMDW_STOP_PP;
if (cmdp_sr_reg) begin
sm <= SM_SETUP;
end
end else begin
sm <= SM_SETUP_SDO;
end
end
`CMDW_STOP_OD,
`CMDW_STOP_PP: begin
sm <= SM_SETUP;
st <= `CMDW_NOP;
cmdp_sr_reg <= 1'b0;
end
`CMDW_IBI_MDB: begin
st <= cmdp_valid_reg ? `CMDW_SR : `CMDW_STOP_PP;
end
default: begin
st <= `CMDW_NOP;
end
endcase
end
end
SM_SETUP_SDO: begin
if (sdo_valid) begin
sm <= SM_TRANSFER;
end
cmdw_body <= sdo;
end
SM_CLEANUP: begin
// The peripheral did not ACK the SM_TRANSFER, so it is cancelled.
// the SDO data is discarded
if (sdo_valid) begin
cmdp_buffer_len_reg <= cmdp_buffer_len_reg - 1;
end
if (cmdp_buffer_len_reg == 0) begin
sm <= SM_SETUP;
end
end
SM_ARBITRATION: begin
if (arbitration_valid) begin
sm <= SM_TRANSFER;
// IBI requested during CMDW_BCAST_7E_W0.
// At the word module, was ACKed if IBI is enabled and DA is known, if not, NACKed.
if (ibi_requested) begin
// Receive MSB if IBI is enabled, dev is known and BCR[2] is 1'b1.
if (ibi_enable & dev_is_attached & ibi_bcr_2) begin
st <= `CMDW_IBI_MDB;
end else begin
st <= cmdp_valid_reg ? `CMDW_START : `CMDW_STOP_OD;
end
// No IBI requested during CMDW_BCAST_7E_W0.
end else if (cmdp_valid_reg) begin
st <= cmdp_ccc_reg ?
(cmdp_ccc_id_reg == CCC_ENTDAA ? `CMDW_CCC_OD : `CMDW_CCC_PP) : `CMDW_MSG_SR;
end else begin
st <= `CMDW_STOP_OD;
end
end
end
default: begin
sm <= SM_SETUP;
end
endcase
end
// Improve timing
error_nack_resp <= cmdw_nack_resp;
error_nack_bcast <= cmdw_nack_bcast;
end
// Bus available condition
always @(posedge clk) begin
if (!reset_n || !nop) begin
bus_avail_reg <= 0;
end else if (!bus_avail) begin
bus_avail_reg <= bus_avail_reg + 1;
end
end
assign bus_avail = &bus_avail_reg;
// Device characteristics look-up.
assign dev_is_i2c = rmap_dev_char_data[0] === 1'b1;
assign dev_is_attached = rmap_dev_char_data[1] === 1'b1;
assign ibi_bcr_2 = rmap_dev_char_data[3] === 1'b1;
assign ibi_dev_is_attached = dev_is_attached;
assign rmap_dev_char_addr = ibi_requested ? ibi_da : cmdp_da_reg;
assign cmdp_ready = sm == SM_SETUP & !cmdw_nack_bcast & !cmdw_nack_resp & reset_n;
assign sdo_ready = (sm == SM_SETUP_SDO | sm == SM_CLEANUP) & !cmdw_nack_bcast & !cmdw_nack_resp & reset_n;
assign cmdw = {st, cmdw_body};
assign cmdw_valid = sm == SM_TRANSFER;
assign ibi_enable = rmap_ibi_config[0];
assign ibi_listen = rmap_ibi_config[1];
assign cmdp_rnw = cmdp[0];
assign cmdp_da = cmdp[7:1];
assign cmdp_buffer_len = cmdp[19:8];
assign cmdp_sr = cmdp[20];
assign cmdp_bcast_header = cmdp[21];
assign cmdp_ccc = cmdp[22];
assign cmdp_ccc_id = cmdp[29:23];
assign cmdp_ccc_bcast = cmdp[30];
assign cmdp_error = {error_nack_resp, error_unknown_da, error_nack_bcast};
endmodule
@@ -0,0 +1,430 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
/**
* Executes Word Commands received by the framing module.
* Each state has linear sub-states counted in Bit Modulation Commands.
*/
`timescale 1ns/100ps
`include "i3c_controller_word.vh"
`include "i3c_controller_bit_mod.vh"
module i3c_controller_word (
input clk,
input reset_n,
// Word command
output reg cmdw_nack_bcast,
output reg cmdw_nack_resp,
output cmdw_ready,
input cmdw_valid,
input [`CMDW_HEADER_WIDTH+8:0] cmdw,
// Byte stream
input sdi_ready,
output reg sdi_valid,
output sdi_last,
output reg [7:0] sdi,
// Bit Modulation Command
output [`MOD_BIT_CMD_WIDTH:0] cmdb,
output cmdb_valid,
input cmdb_ready,
// RX and ACK
input rx,
input rx_valid,
// IBI interface
output reg arbitration_valid,
input ibi_dev_is_attached,
input ibi_bcr_2,
output reg ibi_requested,
input ibi_requested_auto,
output reg ibi_tick,
output [6:0] ibi_da,
output [7:0] ibi_mdb,
// uP accessible info
input [1:0] rmap_ibi_config
);
localparam [6:0] I3C_RESERVED = 7'h7e;
localparam [1:0] SM_GET = 0;
localparam [1:0] SM_SETUP = 1;
localparam [1:0] SM_TRANSFER = 2;
localparam [1:0] SM_RESOLVE = 3;
reg [`CMDW_HEADER_WIDTH:0] st;
reg [`MOD_BIT_CMD_WIDTH:2] cmd_r;
reg [1:0] sm;
reg sg;
reg [7:0] cmdw_body;
reg cmdw_nacked;
reg [7:0] ibi_da_reg;
reg [7:0] ibi_mdb_reg;
reg do_ack; // Peripheral did NACK?
reg do_rx_t; // Peripheral end Message at T in Read Data?
reg cmd_wr;
reg sdi_last_reg;
reg [5:0] i;
reg [5:0] i_;
wire ibi_enable;
wire cmdw_nack;
wire [`CMDW_HEADER_WIDTH:0] cmdw_header;
// # of Bit Modulation Commands - 1 per word
always @(st) begin
case (st)
`CMDW_NOP : i_ = 0;
`CMDW_START : i_ = 0;
`CMDW_BCAST_7E_W0 : i_ = 8; // 7'h7e+RnW=0+ACK / DA+RnW=1+ACK_IBI
`CMDW_CCC_OD : i_ = 8; // Direct/Bcast+CCC+T
`CMDW_CCC_PP : i_ = 8; // Direct/Bcast+CCC+T
`CMDW_TARGET_ADDR_OD : i_ = 8; // DA+RNW+ACK
`CMDW_TARGET_ADDR_PP : i_ = 8; // DA+RNW+ACK
`CMDW_MSG_SR : i_ = 0;
`CMDW_MSG_RX : i_ = 8; // SDI+T
`CMDW_MSG_TX : i_ = 8; // SDO+T
`CMDW_STOP_OD : i_ = 0;
`CMDW_STOP_PP : i_ = 0;
`CMDW_BCAST_7E_W1 : i_ = 8; // 7'h7e+RnW=1+ACK
`CMDW_DAA_DEV_CHAR : i_ = 7; // 8-bit section of the PID+BCR+DCR
`CMDW_DYN_ADDR : i_ = 8; // DA+T+ACK
`CMDW_IBI_MDB : i_ = 8; // MDB+T
`CMDW_SR : i_ = 0;
`CMDW_I2C_TX : i_ = 8; // SDO+ACK
`CMDW_I2C_RX : i_ = 8; // SDI+ACK
default : i_ = 0;
endcase
// Set speed grade (open drain or push-pull) for each word.
case (st)
`CMDW_NOP : sg = 0;
`CMDW_START : sg = 0;
`CMDW_BCAST_7E_W0 : sg = 0;
`CMDW_CCC_OD : sg = 0;
`CMDW_CCC_PP : sg = 1;
`CMDW_TARGET_ADDR_OD : sg = 0;
`CMDW_TARGET_ADDR_PP : sg = 1;
`CMDW_MSG_SR : sg = 0;
`CMDW_MSG_RX : sg = 1;
`CMDW_MSG_TX : sg = 1;
`CMDW_STOP_OD : sg = 0;
`CMDW_STOP_PP : sg = 1;
`CMDW_BCAST_7E_W1 : sg = 0;
`CMDW_DAA_DEV_CHAR : sg = 0;
`CMDW_DYN_ADDR : sg = 0;
`CMDW_IBI_MDB : sg = 1;
`CMDW_SR : sg = 0;
`CMDW_I2C_TX : sg = 0;
`CMDW_I2C_RX : sg = 0;
default : sg = 0;
endcase
end
always @(posedge clk) begin
ibi_tick <= 1'b0;
sdi_valid <= 1'b0;
sdi_last_reg <= 1'b0;
arbitration_valid <= 1'b0;
if (!reset_n) begin
i <= 0;
sm <= SM_GET;
cmd_wr <= 1'b0;
st <= `CMDW_NOP;
ibi_requested <= 1'b0;
cmd_r <= `MOD_BIT_CMD_NOP_;
end else begin
case (sm)
SM_GET: begin
if (cmdw_valid) begin
sm <= SM_SETUP;
end
st <= cmdw_header;
cmdw_body <= cmdw[7:0];
ibi_requested <= ibi_requested_auto;
i <= 0;
cmdw_nacked <= 1'b0;
end
SM_SETUP: begin
sm <= SM_TRANSFER;
do_ack <= 1'b0;
do_rx_t <= 1'b0;
case (st)
`CMDW_NOP: begin
cmd_r <= `MOD_BIT_CMD_NOP_;
end
`CMDW_START: begin
cmd_r <= `MOD_BIT_CMD_START_;
end
`CMDW_BCAST_7E_W0: begin
// During the header broadcast, the peripheral shall issue an IBI, due
// to this the SDO is monitored and if the controller loses arbitration,
// shall ACK if IBI is enabled and the DA is attached.
// If the peripheral's BCR[2] == 1'b1, also receive the MDB.
// If the device is unknown, NACK the ibi request.
// resolved;
if (i[2:1] == 2'b11 & ~ibi_requested) begin
// 1'b0+RnW=0
cmd_r <= `MOD_BIT_CMD_WRITE_;
cmd_wr <= 1'b0;
end else if (i == 8) begin
if (ibi_requested) begin // also ibi_len ...
// ACK if IBI is enabled and device is known if not, NACK.
cmd_r <= ibi_enable & ibi_dev_is_attached ? `MOD_BIT_CMD_ACK_IBI_ : `MOD_BIT_CMD_READ_;
end else begin
// ACK
cmd_r <= `MOD_BIT_CMD_ACK_SDR_;
do_ack <= 1'b1;
end
end else begin
// 6'b111111
cmd_r <= `MOD_BIT_CMD_READ_;
end
end
`CMDW_BCAST_7E_W1: begin
if (i == 7) begin
// RnW=1
cmd_r <= `MOD_BIT_CMD_WRITE_;
cmd_wr <= 1'b1;
end else if (i == 8) begin
// ACK
cmd_r <= `MOD_BIT_CMD_ACK_SDR_;
do_ack <= 1'b1;
end else begin
// 7'h7e
cmd_r <= `MOD_BIT_CMD_WRITE_;
cmd_wr <= I3C_RESERVED[6 - i[2:0]];
end
end
`CMDW_DYN_ADDR,
`CMDW_TARGET_ADDR_OD,
`CMDW_TARGET_ADDR_PP: begin
if (i == 8) begin
// ACK
cmd_r <= `MOD_BIT_CMD_ACK_SDR_;
do_ack <= 1'b1;
end else begin
// DA+RnW/DA+T
cmd_r <= `MOD_BIT_CMD_WRITE_;
cmd_wr <= cmdw_body[7 - i[2:0]];
end
end
`CMDW_SR,
`CMDW_MSG_SR: begin
cmd_r <= `MOD_BIT_CMD_START_;
end
`CMDW_I2C_RX: begin
if (i == 8) begin
// In I2C, the peripheral cannot stop the SM_TRANSFER.
cmd_r <= `MOD_BIT_CMD_WRITE_;
if (sdi_ready) begin
cmd_wr <= 1'b0; // ACK
end else begin
cmd_wr <= 1'b1; // NACK
end
end else begin
// SDI
cmd_r <= `MOD_BIT_CMD_READ_;
end
end
`CMDW_MSG_RX: begin
if (i == 8) begin
// T
if (sdi_ready) begin
if (cmdw_header == `CMDW_STOP_PP) begin
// Peek next command to see if the controller wishes to
// end the SM_TRANSFER.
cmd_r <= `MOD_BIT_CMD_START_;
end else begin
// continue, if peripheral wishes to do so
cmd_r <= `MOD_BIT_CMD_ACK_SDR_;
do_rx_t <= 1'b1;
end
end else begin
cmd_r <= `MOD_BIT_CMD_START_; // stop
end
end else begin
// SDI
cmd_r <= `MOD_BIT_CMD_READ_;
end
end
`CMDW_I2C_TX: begin
if (i == 8) begin
// ACK
do_ack <= 1'b1;
cmd_r <= `MOD_BIT_CMD_READ_;
end else begin
// SDO
cmd_r <= `MOD_BIT_CMD_WRITE_;
cmd_wr <= cmdw_body[7 - i[2:0]];
end
end
`CMDW_CCC_OD,
`CMDW_CCC_PP,
`CMDW_MSG_TX: begin
if (i == 8) begin
// T
cmd_r <= `MOD_BIT_CMD_WRITE_;
cmd_wr <= ~^cmdw_body;
end else begin
// SDO/BCAST+CCC
cmd_r <= `MOD_BIT_CMD_WRITE_;
cmd_wr <= cmdw_body[7 - i[2:0]];
end
end
`CMDW_STOP_OD,
`CMDW_STOP_PP: begin
cmd_r <= `MOD_BIT_CMD_STOP_;
end
`CMDW_DAA_DEV_CHAR: begin
cmd_r <= `MOD_BIT_CMD_READ_;
end
`CMDW_IBI_MDB: begin
if (i == 8) begin
// T
cmd_r <= `MOD_BIT_CMD_READ_;
end else begin
// MDB
cmd_r <= `MOD_BIT_CMD_READ_;
end
end
default: begin
st <= `CMDW_NOP;
end
endcase
end
SM_TRANSFER: begin
if (cmdb_ready) begin
sm <= SM_RESOLVE;
end
end
SM_RESOLVE: begin
if (rx_valid) begin
i <= i + 1;
if (i == i_ | cmdw_nacked) begin
sm <= SM_GET;
end else begin
sm <= SM_SETUP;
end
// Condition to end rx stream:
// * Check if cmdw changed by peeking next cmd earlier
// * Peripheral NACKed
if ((i == i_ & st != cmdw_header) | cmdw_nack) begin
sdi_last_reg <= 1'b1;
end
if (cmdw_nack) begin
st <= sg ? `CMDW_STOP_PP : `CMDW_STOP_OD;
sm <= SM_SETUP;
cmdw_nacked <= 1'b1;
end
ibi_requested <= 1'b0;
case (st)
`CMDW_NOP,
`CMDW_START : begin
ibi_requested <= ibi_requested;
end
`CMDW_BCAST_7E_W0: begin
ibi_da_reg[7-i] <= rx;
// Arbitration for IBI request.
ibi_requested <= i < 6 & rx === 1'b0 ? 1'b1 : ibi_requested;
if (i[2:0] == 7) begin
arbitration_valid <= 1'b1;
if (ibi_enable & ibi_requested & ibi_dev_is_attached & ~ibi_bcr_2) begin
ibi_tick <= 1'b1;
end
end
end
`CMDW_DAA_DEV_CHAR,
`CMDW_I2C_RX,
`CMDW_MSG_RX: begin
if (i == i_) begin
sdi_valid <= 1'b1;
end
/* T-bit is discarded */
sdi[7-i] <= rx;
end
`CMDW_IBI_MDB: begin
if (i[2:0] == 7) begin
ibi_tick <= 1'b1;
end
ibi_mdb_reg[7-i] <= rx;
end
default: begin
end
endcase
end
end
endcase
end
cmdw_nack_bcast <= cmdw_nack && st == `CMDW_BCAST_7E_W0;
cmdw_nack_resp <= cmdw_nack && st != `CMDW_BCAST_7E_W0;
end
assign cmdw_nack = sm == SM_RESOLVE & rx_valid ?
(st == `CMDW_DYN_ADDR ||
st == `CMDW_TARGET_ADDR_OD ||
st == `CMDW_TARGET_ADDR_PP ||
st == `CMDW_BCAST_7E_W1 ||
st == `CMDW_BCAST_7E_W0 ||
st == `CMDW_I2C_RX) ? (do_ack & rx !== 1'b0) :
(st == `CMDW_MSG_RX) ? (do_rx_t & rx === 1'b0) : 1'b0 : 1'b0;
assign cmdw_ready = sm == SM_GET;
assign cmdw_header = cmdw[`CMDW_HEADER_WIDTH+8 -: `CMDW_HEADER_WIDTH+1];
assign ibi_da = ibi_da_reg [7:1];
assign ibi_mdb = ibi_mdb_reg;
assign ibi_enable = rmap_ibi_config[0];
assign cmdb_valid = sm == SM_TRANSFER;
assign cmdb = {cmd_r, sg, cmd_wr};
assign sdi_last = sdi_valid & sdi_last_reg;
endmodule
@@ -0,0 +1,61 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`ifndef WORD_COMMAND_V
`define WORD_COMMAND_V
`define CMDW_HEADER_WIDTH 4
`define CMDW_NOP 5'd00
`define CMDW_START 5'd01
`define CMDW_BCAST_7E_W0 5'd02
`define CMDW_MSG_SR 5'd03
`define CMDW_TARGET_ADDR_OD 5'd04
`define CMDW_TARGET_ADDR_PP 5'd05
`define CMDW_MSG_TX 5'd06
`define CMDW_MSG_RX 5'd07
`define CMDW_CCC_OD 5'd08
`define CMDW_CCC_PP 5'd09
`define CMDW_STOP_OD 5'd10
`define CMDW_STOP_PP 5'd11
`define CMDW_BCAST_7E_W1 5'd12
`define CMDW_DAA_DEV_CHAR 5'd13
`define CMDW_DYN_ADDR 5'd14
`define CMDW_IBI_MDB 5'd15
`define CMDW_SR 5'd16
`define CMDW_I2C_TX 5'd17
`define CMDW_I2C_RX 5'd18
`endif
@@ -0,0 +1,45 @@
# Definitional proc to organize widgets for parameters.
proc init_gui { IPINST } {
ipgui::add_param $IPINST -name "Component_Name"
#Adding Page
set I3C_Controller_Core [ipgui::add_page $IPINST -name "I3C Controller Core" -display_name {AXI I3C Controller Core}]
#Adding Group
set General_Configuration [ipgui::add_group $IPINST -name "General Configuration" -parent ${I3C_Controller_Core}]
set MAX_DEVS [ipgui::add_param $IPINST -name "MAX_DEVS" -parent ${General_Configuration}]
set_property tooltip {[MAX_DEVS] Maximum number of peripherals in the bus, counting the controller} ${MAX_DEVS}
set CLK_MOD [ipgui::add_param $IPINST -name "CLK_MOD" -parent ${General_Configuration} -widget comboBox]
set_property tooltip {[CLK_MOD] Adjust clock cycles required to modulate the lane bus bits. Set 8 to achieve 12.5MHz at 100Mhz input clock, and 4 at 50MHz.} ${CLK_MOD}
}
proc update_PARAM_VALUE.CLK_MOD { PARAM_VALUE.CLK_MOD } {
# Procedure called to update CLK_MOD when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.CLK_MOD { PARAM_VALUE.CLK_MOD } {
# Procedure called to validate CLK_MOD
return true
}
proc update_PARAM_VALUE.MAX_DEVS { PARAM_VALUE.MAX_DEVS } {
# Procedure called to update MAX_DEVS when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.MAX_DEVS { PARAM_VALUE.MAX_DEVS } {
# Procedure called to validate MAX_DEVS
return true
}
proc update_MODELPARAM_VALUE.MAX_DEVS { MODELPARAM_VALUE.MAX_DEVS PARAM_VALUE.MAX_DEVS } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.MAX_DEVS}] ${MODELPARAM_VALUE.MAX_DEVS}
}
proc update_MODELPARAM_VALUE.CLK_MOD { MODELPARAM_VALUE.CLK_MOD PARAM_VALUE.CLK_MOD } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.CLK_MOD}] ${MODELPARAM_VALUE.CLK_MOD}
}
@@ -0,0 +1,44 @@
####################################################################################
## Copyright (c) 2018 - 2024 Analog Devices, Inc.
### SPDX short identifier: BSD-1-Clause
## Auto-generated, do not modify!
####################################################################################
LIBRARY_NAME := i3c_controller_host_interface
GENERIC_DEPS += ../../common/ad_mem_dual.v
GENERIC_DEPS += ../../common/ad_rst.v
GENERIC_DEPS += ../../common/up_axi.v
GENERIC_DEPS += i3c_controller_cmd_parser.v
GENERIC_DEPS += i3c_controller_host_interface.v
GENERIC_DEPS += i3c_controller_pack.v
GENERIC_DEPS += i3c_controller_regmap.v
GENERIC_DEPS += i3c_controller_regmap.vh
GENERIC_DEPS += i3c_controller_unpack.v
GENERIC_DEPS += i3c_controller_write_ibi.v
XILINX_DEPS += ../../xilinx/common/ad_rst_constr.xdc
XILINX_DEPS += i3c_controller_host_interface_constr.ttcl
XILINX_DEPS += i3c_controller_host_interface_ip.tcl
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_cmdp.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_cmdp_rtl.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_rmap.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_rmap_rtl.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_sdio.xml
XILINX_DEPS += ../../i3c_controller/interfaces/i3c_controller_sdio_rtl.xml
XILINX_LIB_DEPS += util_axis_fifo
XILINX_LIB_DEPS += util_cdc
XILINX_INTERFACE_DEPS += i3c_controller/interfaces
INTEL_DEPS += ../../intel/common/up_rst_constr.sdc
INTEL_DEPS += ../../util_axis_fifo/util_axis_fifo.v
INTEL_DEPS += ../../util_axis_fifo/util_axis_fifo_address_generator.v
INTEL_DEPS += ../../util_cdc/sync_bits.v
INTEL_DEPS += ../../util_cdc/sync_gray.v
INTEL_DEPS += i3c_controller_host_interface_constr.sdc
INTEL_DEPS += i3c_controller_host_interface_hw.tcl
include ../../scripts/library.mk
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,237 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
/**
* Parse commands.
* When the first command indicates a pair command (e.g. CCC), await next
* command to complete request (e.g. add CCC ID to parsed CCC command).
* If it is a simple command (e.g. private transfer), their is no pair command.
* Command receipts (cmdr) are transferred at the end of a transfer, with
* updated length field indicating the number of bytes actually transferred,
* since the peripheral shall cancel the transfer.
*/
`timescale 1ns/100ps
module i3c_controller_cmd_parser (
input clk,
input reset_n,
// Command FIFO
output cmd_ready,
input cmd_valid,
input [31:0] cmd,
input cmdr_ready,
output cmdr_valid,
output [31:0] cmdr,
// Command parsed
input cmdp_ready,
output cmdp_valid,
output [30:0] cmdp,
input [2:0] cmdp_error,
output rd_bytes_stop,
input [11:0] rd_bytes_lvl,
input wr_bytes_stop,
input [11:0] wr_bytes_lvl
);
// Check bit 3 for any type of NACK (CE2_ERROR + NACK_RESP).
// Check bit 4 for unknown address.
// CE1_ERROR and CE3_ERROR are not implemented.
localparam [3:0] NO_ERROR = 4'd0;
localparam [3:0] CE0_ERROR = 4'd1;
localparam [3:0] CE2_ERROR = 4'd4;
localparam [3:0] NACK_RESP = 4'd6;
localparam [3:0] UDA_ERROR = 4'd8;
localparam [6:0] CCC_ENTDAA = 'h07;
localparam [2:0] SM_RECEIVE = 0;
localparam [2:0] SM_XFER_WAIT = 1;
localparam [2:0] SM_XFER_WAIT_READY = 2;
localparam [2:0] SM_CCC_WAIT = 3;
localparam [2:0] SM_PRE_RECEIPT = 4;
localparam [2:0] SM_RECEIPT = 5;
reg [31:0] cmdr1;
reg [7:0] cmdr2;
reg [3:0] cmdr_error;
reg [7:0] cmdr_sync;
reg error_nack_bcast_reg;
reg error_nack_resp_reg;
reg error_unknown_da_reg;
reg [2:0] sm;
reg wr_bytes_stop_reg;
reg [11:0] wr_bytes_lvl_reg;
wire cmdp_rnw;
wire [11:0] cmdp_buffer_len;
wire cmdp_ccc;
wire [6:0] cmdp_ccc_id;
wire error_nack_bcast;
wire error_unknown_da;
wire error_nack_resp;
wire [11:0] cmdr1_len;
always @(posedge clk) begin
if (!reset_n) begin
sm <= SM_RECEIVE;
cmdr_error <= NO_ERROR;
cmdr_sync <= 8'd0;
end else begin
case (sm)
SM_RECEIVE: begin
cmdr_error <= NO_ERROR;
cmdr2 <= 8'd0;
if (cmd_valid) begin
cmdr1 <= cmd;
/* cmd[22] is cmdp_ccc */
sm <= cmd[22] ? SM_CCC_WAIT : SM_XFER_WAIT;
end else begin
sm <= SM_RECEIVE;
end
error_nack_bcast_reg <= 1'b0;
error_unknown_da_reg <= 1'b0;
error_nack_resp_reg <= 1'b0;
end
SM_XFER_WAIT: begin
sm <= cmdp_ready ? SM_XFER_WAIT_READY : sm;
end
SM_XFER_WAIT_READY: begin
if (cmdp_ready) begin
sm <= SM_PRE_RECEIPT;
end
if (error_nack_bcast) begin
error_nack_bcast_reg <= error_nack_bcast;
end
if (error_unknown_da) begin
error_unknown_da_reg <= error_unknown_da;
end
if (error_nack_resp) begin
error_nack_resp_reg <= error_nack_resp;
end
end
SM_CCC_WAIT: begin
cmdr2 <= cmd[7:0];
if (cmd_valid) begin
sm <= SM_XFER_WAIT;
end
end
SM_PRE_RECEIPT: begin
// CE1_ERROR and CE3_ERROR not implemented.
if (cmdp_ccc & |wr_bytes_lvl) begin
cmdr_error <= CE0_ERROR;
end else if (error_nack_bcast_reg) begin
cmdr_error <= CE2_ERROR;
end else if (error_unknown_da_reg) begin
cmdr_error <= UDA_ERROR;
end else if (error_nack_resp_reg) begin
cmdr_error <= NACK_RESP;
end
// Ensure all receipt content is ok
sm <= SM_RECEIPT;
end
SM_RECEIPT: begin
if (cmdr_ready) begin
sm <= SM_RECEIVE;
cmdr_sync <= cmdr_sync + 1;
end
end
default: begin
sm <= SM_RECEIVE;
end
endcase
end
end
// Lock on last sdi_bytes_lvl for the cmd
// Since level increment on get state and is cleared by last on put phase,
// delay i clock cycle.
// Clear when cmr is read, since some RX transfer might get NACKed at
// 0 bytes (no sdi_last).
always @(posedge clk) begin
wr_bytes_stop_reg <= wr_bytes_stop;
if (cmdr_valid & cmdr_ready) begin
wr_bytes_lvl_reg <= 0;
end else if (wr_bytes_stop_reg) begin
wr_bytes_lvl_reg <= wr_bytes_lvl;
end
end
assign cmd_ready = (sm == SM_RECEIVE || sm == SM_CCC_WAIT) & reset_n;
assign cmdp_valid = (sm == SM_XFER_WAIT & reset_n);
assign cmdr = {8'd0, cmdr_error, cmdr1_len, cmdr_sync};
assign cmdr_valid = sm == SM_RECEIPT;
// For read bytes (write to peripheral), it is either all transferred or none,
// since the peripheral can only reject during the address ACK.
// For write bytes (read from peripheral), the peripheral shall cancel
// before finishing the transfer.
assign cmdr1_len = cmdp_rnw ?
wr_bytes_lvl_reg :
(error_nack_bcast_reg | error_nack_resp_reg ?
12'd0 : cmdp_buffer_len
);
assign rd_bytes_stop = (cmdp_buffer_len == rd_bytes_lvl) & |rd_bytes_lvl;
assign cmdp_rnw = cmdr1[0];
assign cmdp_ccc = cmdr1[22];
// The Linux implementation sets ENTDAA buffer length to 0,
// but we need with 1 to contiguously fetch the DAs.
assign cmdp_buffer_len = cmdp_ccc_id == CCC_ENTDAA ? 1 : cmdr1[19:08];
assign cmdp_ccc_id = cmdr2[6:0];
assign error_nack_bcast = cmdp_error[0];
assign error_unknown_da = cmdp_error[1];
assign error_nack_resp = cmdp_error[2];
// Remove reserved bits.
assign cmdp = {
cmdr2[7:0],
cmdr1[22:0]
};
endmodule
@@ -0,0 +1,253 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`timescale 1ns/100ps
module i3c_controller_host_interface #(
parameter ID = 0,
parameter ASYNC_CLK = 0,
parameter OFFLOAD = 1
) (
input clk,
output reset_n,
// Slave AXI interface
input s_axi_aclk,
input s_axi_aresetn,
input s_axi_awvalid,
input [15:0] s_axi_awaddr,
output s_axi_awready,
input [2:0] s_axi_awprot,
input s_axi_wvalid,
input [31:0] s_axi_wdata,
input [ 3:0] s_axi_wstrb,
output s_axi_wready,
output s_axi_bvalid,
output [ 1:0] s_axi_bresp,
input s_axi_bready,
input s_axi_arvalid,
input [15:0] s_axi_araddr,
output s_axi_arready,
input [2:0] s_axi_arprot,
output s_axi_rvalid,
input s_axi_rready,
output [ 1:0] s_axi_rresp,
output [31:0] s_axi_rdata,
output irq,
input offload_trigger,
// Command parsed
input cmdp_ready,
output cmdp_valid,
output [30:0] cmdp,
input [2:0] cmdp_error,
input cmdp_nop,
input cmdp_daa_trigger,
// Byte stream
input sdo_ready,
output sdo_valid,
output [7:0] sdo,
output sdi_ready,
input sdi_valid,
input sdi_last,
input [7:0] sdi,
output ibi_ready,
input ibi_valid,
input [14:0] ibi,
input offload_sdi_ready,
output offload_sdi_valid,
output [31:0] offload_sdi,
// uP accessible info
output [1:0] rmap_ibi_config,
output [1:0] rmap_pp_sg,
input [6:0] rmap_dev_char_addr,
output [3:0] rmap_dev_char_data
);
wire rd_bytes_stop;
wire [11:0] rd_bytes_lvl;
wire [11:0] wr_bytes_lvl;
wire cmd_ready;
wire cmd_valid;
wire [31:0] cmd;
wire cmdr_ready;
wire cmdr_valid;
wire [31:0] cmdr;
wire sdo_ready_w;
wire sdo_valid_w;
wire [31:0] sdo_w;
wire sdi_ready_w;
wire sdi_valid_w;
wire [31:0] sdi_w;
wire ibi_ready_w;
wire ibi_valid_w;
wire [31:0] ibi_w;
wire clk_w;
generate if (ASYNC_CLK) begin
assign clk_w = clk;
end else begin
assign clk_w = s_axi_aclk;
end
endgenerate
i3c_controller_regmap #(
.ID(ID),
.OFFLOAD(OFFLOAD),
.ASYNC_CLK(ASYNC_CLK)
) i_i3c_controller_regmap (
.s_axi_aclk(s_axi_aclk),
.s_axi_aresetn(s_axi_aresetn),
.s_axi_awvalid(s_axi_awvalid),
.s_axi_awaddr(s_axi_awaddr),
.s_axi_awready(s_axi_awready),
.s_axi_awprot(s_axi_awprot),
.s_axi_wvalid(s_axi_wvalid),
.s_axi_wdata(s_axi_wdata),
.s_axi_wstrb(s_axi_wstrb),
.s_axi_wready(s_axi_wready),
.s_axi_bvalid(s_axi_bvalid),
.s_axi_bresp(s_axi_bresp),
.s_axi_bready(s_axi_bready),
.s_axi_arvalid(s_axi_arvalid),
.s_axi_araddr(s_axi_araddr),
.s_axi_arready(s_axi_arready),
.s_axi_arprot(s_axi_arprot),
.s_axi_rvalid(s_axi_rvalid),
.s_axi_rready(s_axi_rready),
.s_axi_rresp(s_axi_rresp),
.s_axi_rdata(s_axi_rdata),
.irq(irq),
.clk(clk),
.a_reset_n(reset_n),
.cmd_nop(cmdp_nop),
.cmd_ready(cmd_ready),
.cmd_valid(cmd_valid),
.cmd(cmd),
.cmdr_ready(cmdr_ready),
.cmdr_valid(cmdr_valid),
.cmdr(cmdr),
.sdo_ready(sdo_ready_w),
.sdo_valid(sdo_valid_w),
.sdo(sdo_w),
.sdi_ready(sdi_ready_w),
.sdi_valid(sdi_valid_w),
.sdi(sdi_w),
.offload_sdi_ready(offload_sdi_ready),
.offload_sdi_valid(offload_sdi_valid),
.offload_sdi(offload_sdi),
.ibi_ready(ibi_ready_w),
.ibi_valid(ibi_valid_w),
.ibi(ibi_w),
.daa_trigger(cmdp_daa_trigger),
.offload_trigger(offload_trigger),
.rmap_ibi_config(rmap_ibi_config),
.rmap_pp_sg(rmap_pp_sg),
.rmap_dev_char_addr(rmap_dev_char_addr),
.rmap_dev_char_data(rmap_dev_char_data));
i3c_controller_unpack
i_i3c_controller_unpack (
.clk(clk_w),
.reset_n(reset_n),
.stop(rd_bytes_stop),
.u32_ready(sdo_ready_w),
.u32_valid(sdo_valid_w),
.u32(sdo_w),
.u8_lvl(rd_bytes_lvl),
.u8_ready(sdo_ready),
.u8_valid(sdo_valid),
.u8(sdo));
i3c_controller_pack
i_i3c_controller_pack (
.clk(clk_w),
.reset_n(reset_n),
.u32_ready(sdi_ready_w),
.u32_valid(sdi_valid_w),
.u32(sdi_w),
.u8_lvl(wr_bytes_lvl),
.u8_ready(sdi_ready),
.u8_valid(sdi_valid),
.u8_last(sdi_last),
.u8(sdi));
i3c_controller_write_ibi
i_i3c_controller_write_ibi (
.clk(clk_w),
.reset_n(reset_n),
.out_ready(ibi_ready_w),
.out_valid(ibi_valid_w),
.out(ibi_w),
.in_ready(ibi_ready),
.in_valid(ibi_valid),
.in(ibi));
i3c_controller_cmd_parser
i_i3c_controller_cmd_parser (
.clk(clk_w),
.reset_n(reset_n),
.cmd_ready(cmd_ready),
.cmd_valid(cmd_valid),
.cmd(cmd),
.cmdr_ready(cmdr_ready),
.cmdr_valid(cmdr_valid),
.cmdr(cmdr),
.cmdp_valid(cmdp_valid),
.cmdp_ready(cmdp_ready),
.cmdp(cmdp),
.cmdp_error(cmdp_error),
.rd_bytes_stop(rd_bytes_stop),
.rd_bytes_lvl(rd_bytes_lvl),
.wr_bytes_stop(sdi_last),
.wr_bytes_lvl(wr_bytes_lvl));
endmodule
@@ -0,0 +1,468 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Product Version: Vivado v2024.1 (64-bit) -->
<!-- -->
<!-- Copyright 1986-2022 Xilinx, Inc. All Rights Reserved. -->
<!-- Copyright 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved. -->
<Project Product="Vivado" Version="7" Minor="67" Path="/home/josh/Downloads/hdl/library/i3c_controller/i3c_controller_host_interface/i3c_controller_host_interface.xpr">
<DefaultLaunch Dir="$PRUNDIR"/>
<Configuration>
<Option Name="Id" Val="67aaba48adfd41f9a5dcea643187b0ce"/>
<Option Name="Part" Val="xc7vx485tffg1157-1"/>
<Option Name="CompiledLibDir" Val="$PCACHEDIR/compile_simlib"/>
<Option Name="CompiledLibDirXSim" Val=""/>
<Option Name="CompiledLibDirModelSim" Val="$PCACHEDIR/compile_simlib/modelsim"/>
<Option Name="CompiledLibDirQuesta" Val="$PCACHEDIR/compile_simlib/questa"/>
<Option Name="CompiledLibDirXcelium" Val="$PCACHEDIR/compile_simlib/xcelium"/>
<Option Name="CompiledLibDirVCS" Val="$PCACHEDIR/compile_simlib/vcs"/>
<Option Name="CompiledLibDirRiviera" Val="$PCACHEDIR/compile_simlib/riviera"/>
<Option Name="CompiledLibDirActivehdl" Val="$PCACHEDIR/compile_simlib/activehdl"/>
<Option Name="SimulatorInstallDirModelSim" Val=""/>
<Option Name="SimulatorInstallDirQuesta" Val=""/>
<Option Name="SimulatorInstallDirXcelium" Val=""/>
<Option Name="SimulatorInstallDirVCS" Val=""/>
<Option Name="SimulatorInstallDirRiviera" Val=""/>
<Option Name="SimulatorInstallDirActiveHdl" Val=""/>
<Option Name="SimulatorGccInstallDirModelSim" Val=""/>
<Option Name="SimulatorGccInstallDirQuesta" Val=""/>
<Option Name="SimulatorGccInstallDirXcelium" Val=""/>
<Option Name="SimulatorGccInstallDirVCS" Val=""/>
<Option Name="SimulatorGccInstallDirRiviera" Val=""/>
<Option Name="SimulatorGccInstallDirActiveHdl" Val=""/>
<Option Name="SimulatorVersionXsim" Val="2024.1"/>
<Option Name="SimulatorVersionModelSim" Val="2023.2"/>
<Option Name="SimulatorVersionQuesta" Val="2023.2"/>
<Option Name="SimulatorVersionXcelium" Val="23.03.002"/>
<Option Name="SimulatorVersionVCS" Val="U-2023.03-1"/>
<Option Name="SimulatorVersionRiviera" Val="2023.04"/>
<Option Name="SimulatorVersionActiveHdl" Val="14.1"/>
<Option Name="SimulatorGccVersionXsim" Val="9.3.0"/>
<Option Name="SimulatorGccVersionModelSim" Val="7.4.0"/>
<Option Name="SimulatorGccVersionQuesta" Val="7.4.0"/>
<Option Name="SimulatorGccVersionXcelium" Val="9.3.0"/>
<Option Name="SimulatorGccVersionVCS" Val="9.2.0"/>
<Option Name="SimulatorGccVersionRiviera" Val="9.3.0"/>
<Option Name="SimulatorGccVersionActiveHdl" Val="9.3.0"/>
<Option Name="BoardPart" Val=""/>
<Option Name="ActiveSimSet" Val="sim_1"/>
<Option Name="DefaultLib" Val="xil_defaultlib"/>
<Option Name="ProjectType" Val="Default"/>
<Option Name="IPRepoPath" Val="$PPRDIR/../../../library"/>
<Option Name="IPOutputRepo" Val="$PCACHEDIR/ip"/>
<Option Name="IPDefaultOutputPath" Val="$PGENDIR/sources_1"/>
<Option Name="IPCachePermission" Val="read"/>
<Option Name="IPCachePermission" Val="write"/>
<Option Name="EnableCoreContainer" Val="FALSE"/>
<Option Name="EnableResourceEstimation" Val="FALSE"/>
<Option Name="SimCompileState" Val="TRUE"/>
<Option Name="CreateRefXciForCoreContainers" Val="FALSE"/>
<Option Name="IPUserFilesDir" Val="$PIPUSERFILESDIR"/>
<Option Name="IPStaticSourceDir" Val="$PIPUSERFILESDIR/ipstatic"/>
<Option Name="EnableBDX" Val="FALSE"/>
<Option Name="WTXSimLaunchSim" Val="0"/>
<Option Name="WTModelSimLaunchSim" Val="0"/>
<Option Name="WTQuestaLaunchSim" Val="0"/>
<Option Name="WTIesLaunchSim" Val="0"/>
<Option Name="WTVcsLaunchSim" Val="0"/>
<Option Name="WTRivieraLaunchSim" Val="0"/>
<Option Name="WTActivehdlLaunchSim" Val="0"/>
<Option Name="WTXSimExportSim" Val="0"/>
<Option Name="WTModelSimExportSim" Val="0"/>
<Option Name="WTQuestaExportSim" Val="0"/>
<Option Name="WTIesExportSim" Val="0"/>
<Option Name="WTVcsExportSim" Val="0"/>
<Option Name="WTRivieraExportSim" Val="0"/>
<Option Name="WTActivehdlExportSim" Val="0"/>
<Option Name="GenerateIPUpgradeLog" Val="TRUE"/>
<Option Name="XSimRadix" Val="hex"/>
<Option Name="XSimTimeUnit" Val="ns"/>
<Option Name="XSimArrayDisplayLimit" Val="1024"/>
<Option Name="XSimTraceLimit" Val="65536"/>
<Option Name="SimTypes" Val="rtl"/>
<Option Name="SimTypes" Val="bfm"/>
<Option Name="SimTypes" Val="tlm"/>
<Option Name="SimTypes" Val="tlm_dpi"/>
<Option Name="MEMEnableMemoryMapGeneration" Val="TRUE"/>
<Option Name="DcpsUptoDate" Val="TRUE"/>
<Option Name="ClassicSocBoot" Val="FALSE"/>
<Option Name="LocalIPRepoLeafDirName" Val="ip_repo"/>
</Configuration>
<FileSets Version="1" Minor="32">
<FileSet Name="sources_1" Type="DesignSrcs" RelSrcDir="$PSRCDIR/sources_1" RelGenDir="$PGENDIR/sources_1">
<Filter Type="Srcs"/>
<File Path="$PPRDIR/../../common/ad_mem_dual.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../../common/ad_rst.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_cmd_parser.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_pack.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_regmap.vh">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="simulation"/>
<Attr Name="IsVisible" Val="1"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_regmap.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_unpack.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_write_ibi.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/../../common/up_axi.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_host_interface.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/i3c_controller_host_interface_constr.ttcl"/>
<File Path="$PPRDIR/component.xml">
<FileInfo SFType="IPXACT"/>
</File>
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopModule" Val="i3c_controller_host_interface"/>
</Config>
</FileSet>
<FileSet Name="constrs_1" Type="Constrs" RelSrcDir="$PSRCDIR/constrs_1" RelGenDir="$PGENDIR/constrs_1">
<Filter Type="Constrs"/>
<File Path="$PPRDIR/../../xilinx/common/ad_rst_constr.xdc">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
</FileInfo>
</File>
<Config>
<Option Name="ConstrsType" Val="XDC"/>
</Config>
</FileSet>
<FileSet Name="sim_1" Type="SimulationSrcs" RelSrcDir="$PSRCDIR/sim_1" RelGenDir="$PGENDIR/sim_1">
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopAutoSet" Val="TRUE"/>
<Option Name="TransportPathDelay" Val="0"/>
<Option Name="TransportIntDelay" Val="0"/>
<Option Name="SelectedSimModel" Val="rtl"/>
<Option Name="PamDesignTestbench" Val=""/>
<Option Name="PamDutBypassFile" Val="xil_dut_bypass"/>
<Option Name="PamSignalDriverFile" Val="xil_bypass_driver"/>
<Option Name="PamPseudoTop" Val="pseudo_tb"/>
<Option Name="SrcSet" Val="sources_1"/>
</Config>
</FileSet>
<FileSet Name="utils_1" Type="Utils" RelSrcDir="$PSRCDIR/utils_1" RelGenDir="$PGENDIR/utils_1">
<Filter Type="Utils"/>
<Config>
<Option Name="TopAutoSet" Val="TRUE"/>
</Config>
</FileSet>
</FileSets>
<Simulators>
<Simulator Name="XSim">
<Option Name="Description" Val="Vivado Simulator"/>
<Option Name="CompiledLib" Val="0"/>
</Simulator>
<Simulator Name="ModelSim">
<Option Name="Description" Val="ModelSim Simulator"/>
</Simulator>
<Simulator Name="Questa">
<Option Name="Description" Val="Questa Advanced Simulator"/>
</Simulator>
<Simulator Name="Xcelium">
<Option Name="Description" Val="Xcelium Parallel Simulator"/>
</Simulator>
<Simulator Name="VCS">
<Option Name="Description" Val="Verilog Compiler Simulator (VCS)"/>
</Simulator>
<Simulator Name="Riviera">
<Option Name="Description" Val="Riviera-PRO Simulator"/>
</Simulator>
</Simulators>
<Runs Version="1" Minor="22">
<Run Id="synth_1" Type="Ft3:Synth" SrcSet="sources_1" Part="xc7vx485tffg1157-1" ConstrsSet="constrs_1" Description="Vivado Synthesis Defaults" AutoIncrementalCheckpoint="true" WriteIncrSynthDcp="false" State="current" IncludeInArchive="true" IsChild="false" AutoIncrementalDir="$PSRCDIR/utils_1/imports/synth_1" AutoRQSDir="$PSRCDIR/utils_1/imports/synth_1" ParallelReportGen="true">
<Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Synthesis Defaults" Flow="Vivado Synthesis 2024">
<Desc>Vivado Synthesis Defaults</Desc>
</StratHandle>
<Step Id="synth_design"/>
</Strategy>
<ReportStrategy Name="Vivado Synthesis Default Reports" Flow="Vivado Synthesis 2024"/>
<Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
<RQSFiles/>
</Run>
<Run Id="impl_1" Type="Ft2:EntireDesign" Part="xc7vx485tffg1157-1" ConstrsSet="constrs_1" Description="Default settings for Implementation." AutoIncrementalCheckpoint="false" WriteIncrSynthDcp="false" State="current" SynthRun="synth_1" IncludeInArchive="true" IsChild="false" GenFullBitstream="true" AutoIncrementalDir="$PSRCDIR/utils_1/imports/impl_1" AutoRQSDir="$PSRCDIR/utils_1/imports/impl_1" ParallelReportGen="true">
<Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Implementation Defaults" Flow="Vivado Implementation 2024">
<Desc>Default settings for Implementation.</Desc>
</StratHandle>
<Step Id="init_design"/>
<Step Id="opt_design"/>
<Step Id="power_opt_design"/>
<Step Id="place_design"/>
<Step Id="post_place_power_opt_design"/>
<Step Id="phys_opt_design"/>
<Step Id="route_design"/>
<Step Id="post_route_phys_opt_design"/>
<Step Id="write_bitstream"/>
</Strategy>
<ReportStrategy Name="Vivado Implementation Default Reports" Flow="Vivado Implementation 2024"/>
<Report Name="ROUTE_DESIGN.REPORT_METHODOLOGY" Enabled="1"/>
<RQSFiles/>
</Run>
</Runs>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="Vivado 12-1790"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="1"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="Evaluation"/>
<MsgAttr Name="StringsToMatch" Val="features"/>
<MsgAttr Name="StringsToMatch" Val="should"/>
<MsgAttr Name="StringsToMatch" Val="NOT"/>
<MsgAttr Name="StringsToMatch" Val="be"/>
<MsgAttr Name="StringsToMatch" Val="used"/>
<MsgAttr Name="StringsToMatch" Val="in"/>
<MsgAttr Name="StringsToMatch" Val="production"/>
<MsgAttr Name="StringsToMatch" Val="systems."/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="Designutils 20-3303"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="10"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="HDPYFinalizeIO"/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="Place 30-73"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="11"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="axi_spi"/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val=""/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="12"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
<MsgAttr Name="StringsToMatch" Val="PCW_UIPARAM_DDR_DQS_TO_CLK_DELAY"/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="BD 41-1343"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="2"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="BD 41-1306"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="3"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="ERROR"/>
<MsgAttr Name="Id" Val="BD 41-1276"/>
<MsgAttr Name="Severity" Val="CRITICAL WARNING"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="4"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="IP_Flow 19-3656"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="5"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="IP_Flow 19-4623"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="6"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="IP_Flow 19-459"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="7"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="INFO"/>
<MsgAttr Name="Id" Val="Synth 8-3331"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="8"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<MsgRule>
<MsgAttr Name="RuleType" Val="1"/>
<MsgAttr Name="Limit" Val="-1"/>
<MsgAttr Name="NewSeverity" Val="WARNING"/>
<MsgAttr Name="Id" Val="Synth 8-2490"/>
<MsgAttr Name="Severity" Val="ANY"/>
<MsgAttr Name="ShowRule" Val="1"/>
<MsgAttr Name="RuleSource" Val="2"/>
<MsgAttr Name="StringIsRegExp" Val="0"/>
<MsgAttr Name="RuleId" Val="9"/>
<MsgAttr Name="Note" Val=""/>
<MsgAttr Name="Author" Val=""/>
<MsgAttr Name="CreatedTimestamp" Val=""/>
</MsgRule>
<Board/>
<DashboardSummary Version="1" Minor="0">
<Dashboards>
<Dashboard Name="default_dashboard">
<Gadgets>
<Gadget Name="drc_1" Type="drc" Version="1" Row="2" Column="0">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_drc_0 "/>
</Gadget>
<Gadget Name="methodology_1" Type="methodology" Version="1" Row="2" Column="1">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_methodology_0 "/>
</Gadget>
<Gadget Name="power_1" Type="power" Version="1" Row="1" Column="0">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_power_0 "/>
</Gadget>
<Gadget Name="timing_1" Type="timing" Version="1" Row="0" Column="1">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_route_report_timing_summary_0 "/>
</Gadget>
<Gadget Name="utilization_1" Type="utilization" Version="1" Row="0" Column="0">
<GadgetParam Name="REPORTS" Type="string_list" Value="synth_1#synth_1_synth_report_utilization_0 "/>
<GadgetParam Name="RUN.STEP" Type="string" Value="synth_design"/>
<GadgetParam Name="RUN.TYPE" Type="string" Value="synthesis"/>
</Gadget>
<Gadget Name="utilization_2" Type="utilization" Version="1" Row="1" Column="1">
<GadgetParam Name="REPORTS" Type="string_list" Value="impl_1#impl_1_place_report_utilization_0 "/>
</Gadget>
</Gadgets>
</Dashboard>
<CurrentDashboard>default_dashboard</CurrentDashboard>
</Dashboards>
</DashboardSummary>
</Project>
@@ -0,0 +1,4 @@
###############################################################################
## Copyright (C) 2020-2024 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################
@@ -0,0 +1,26 @@
###############################################################################
## Copyright (C) 2014 Analog Devices, Inc. All rights reserved.
# SPDX short identifier: ADIBSD
###############################################################################
<: set ComponentName [getComponentNameString] :>
<: setOutputDirectory "./" :>
<: setFileName [ttcl_add $ComponentName "_constr"] :>
<: setFileExtension ".xdc" :>
<: setFileProcessingOrder late :>
<: set async_clk [getBooleanValue "ASYNC_CLK"] :>
<: if { $async_clk } { :>
set_property ASYNC_REG TRUE \
[get_cells -quiet -hierarchical *cdc_sync_stage1_reg*] \
[get_cells -quiet -hierarchical *cdc_sync_stage2_reg*]
set_false_path -quiet \
-from [get_cells -quiet -hierarchical -filter {NAME =~ *i_address_gray/*cdc_sync_stage0_reg* && IS_SEQUENTIAL}] \
-to [get_cells -quiet -hierarchical -filter {NAME =~ *i_address_gray/*cdc_sync_stage1_reg* && IS_SEQUENTIAL}]
set_false_path -quiet \
-to [get_cells -quiet -hierarchical -filter {NAME =~ *i_fifo_status/cdc_sync_stage1_reg* && IS_SEQUENTIAL}]
<: } :>
@@ -0,0 +1,137 @@
###############################################################################
## Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################
package require qsys 14.0
source ../../../scripts/adi_env.tcl
source ../../scripts/adi_ip_intel.tcl
ad_ip_create i3c_controller_host_interface {I3C Controller Host Interface}
set_module_property ELABORATION_CALLBACK p_elaboration
ad_ip_files i3c_controller_host_interface [list \
$ad_hdl_dir/library/util_axis_fifo/util_axis_fifo.v \
$ad_hdl_dir/library/util_axis_fifo/util_axis_fifo_address_generator.v \
$ad_hdl_dir/library/util_cdc/sync_bits.v \
$ad_hdl_dir/library/util_cdc/sync_gray.v \
$ad_hdl_dir/library/common/ad_mem_dual.v \
$ad_hdl_dir/library/common/ad_rst.v \
$ad_hdl_dir/library/common/up_axi.v \
$ad_hdl_dir/library/intel/common/up_rst_constr.sdc \
i3c_controller_host_interface_constr.sdc \
i3c_controller_host_interface.v \
i3c_controller_regmap.v \
i3c_controller_regmap.vh \
i3c_controller_cmd_parser.v \
i3c_controller_pack.v \
i3c_controller_unpack.v \
i3c_controller_write_ibi.v \
]
# Parameters
ad_ip_parameter ID INTEGER 0
ad_ip_parameter ASYNC_CLK INTEGER 0
ad_ip_parameter OFFLOAD INTEGER 0
proc p_elaboration {} {
set disabled_intfs {}
# Read parameters
set id [get_parameter_value "ID"]
set async_clk [get_parameter_value "ASYNC_CLK"]
set offload [get_parameter_value "OFFLOAD"]
# Interrupt
add_interface interrupt_sender interrupt end
add_interface_port interrupt_sender irq irq Output 1
# AXI Memory Mapped interface
ad_ip_intf_s_axi s_axi_aclk s_axi_aresetn 16
set_interface_property interrupt_sender associatedAddressablePoint s_axi
set_interface_property interrupt_sender associatedClock s_axi_clock
set_interface_property interrupt_sender associatedReset s_axi_reset
set_interface_property interrupt_sender ENABLED true
ad_interface clock clk input 1
if {!($async_clk)} {
set if_clk s_axi_clock
} else {
set if_clk if_clk
}
ad_interface reset reset_n output 1 $if_clk
ad_interface signal offload_trigger input 1 if_pwm
add_interface sdo axi4stream start
add_interface_port sdo sdo_ready tready input 1
add_interface_port sdo sdo_valid tvalid output 1
add_interface_port sdo sdo tdata output 8
set_interface_property sdo associatedClock $if_clk
set_interface_property sdo associatedReset if_reset_n
add_interface sdi axi4stream end
add_interface_port sdi sdi_ready tready output 1
add_interface_port sdi sdi_valid tvalid input 1
add_interface_port sdi sdi_last tlast input 1
add_interface_port sdi sdi tdata input 8
set_interface_property sdi associatedClock $if_clk
set_interface_property sdi associatedReset if_reset_n
add_interface ibi axi4stream end
add_interface_port ibi ibi_ready tready output 1
add_interface_port ibi ibi_valid tvalid input 1
add_interface_port ibi ibi tdata input 15
set_interface_property ibi associatedClock $if_clk
set_interface_property ibi associatedReset if_reset_n
add_interface offload_sdi axi4stream start
add_interface_port offload_sdi offload_sdi_ready tready input 1
add_interface_port offload_sdi offload_sdi_valid tvalid output 1
add_interface_port offload_sdi offload_sdi tdata output 32
set_interface_property offload_sdi associatedClock $if_clk
set_interface_property offload_sdi associatedReset if_reset_n
add_interface cmdp conduit start
add_interface_port cmdp cmdp_ready cready input 1
add_interface_port cmdp cmdp_valid cvalid output 1
add_interface_port cmdp cmdp cdata output 31
add_interface_port cmdp cmdp_error error input 3
add_interface_port cmdp cmdp_nop nop input 1
add_interface_port cmdp cmdp_daa_trigger daa_trigger input 1
set_interface_property cmdp associatedClock $if_clk
set_interface_property cmdp associatedReset if_reset_n
add_interface rmap conduit start
add_interface_port rmap rmap_ibi_config ibi_config output 2
add_interface_port rmap rmap_pp_sg pp_sg output 2
add_interface_port rmap rmap_dev_char_addr dev_char_addr input 7
add_interface_port rmap rmap_dev_char_data dev_char_data output 4
set_interface_property rmap associatedClock $if_clk
set_interface_property rmap associatedReset if_reset_n
if {!($offload)} {
lappend disabled_intfs offload_sdi if_offload_trigger
}
if {!($async_clk)} {
lappend disabled_intfs if_clk
}
foreach interface $disabled_intfs {
set_interface_property $interface ENABLED false
}
}
@@ -0,0 +1,156 @@
###############################################################################
## Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################
source ../../../scripts/adi_env.tcl
source $ad_hdl_dir/library/scripts/adi_ip_xilinx.tcl
global VIVADO_IP_LIBRARY
adi_ip_create i3c_controller_host_interface
adi_ip_files i3c_controller_host_interface [list \
"$ad_hdl_dir/library/common/up_axi.v" \
"$ad_hdl_dir/library/common/ad_rst.v" \
"$ad_hdl_dir/library/common/ad_mem_dual.v" \
"$ad_hdl_dir/library/xilinx/common/ad_rst_constr.xdc" \
"i3c_controller_host_interface_constr.ttcl" \
"i3c_controller_host_interface.v" \
"i3c_controller_regmap.v" \
"i3c_controller_regmap.vh" \
"i3c_controller_cmd_parser.v" \
"i3c_controller_pack.v" \
"i3c_controller_unpack.v" \
"i3c_controller_write_ibi.v" \
]
adi_ip_properties i3c_controller_host_interface
adi_ip_ttcl i3c_controller_host_interface "i3c_controller_host_interface_constr.ttcl"
adi_ip_add_core_dependencies [list \
analog.com:$VIVADO_IP_LIBRARY:util_axis_fifo:1.0 \
analog.com:$VIVADO_IP_LIBRARY:util_cdc:1.0 \
]
set_property company_url {https://wiki.analog.com/resources/fpga/peripherals/i3c_controller/host_interface} [ipx::current_core]
## Interface definitions
adi_add_bus "sdio" "master" \
"analog.com:interface:i3c_controller_sdio_rtl:1.0" \
"analog.com:interface:i3c_controller_sdio:1.0" \
{
{"sdo_ready" "sdo_ready"} \
{"sdo_valid" "sdo_valid"} \
{"sdo" "sdo"} \
{"sdi_ready" "sdi_ready"} \
{"sdi_valid" "sdi_valid"} \
{"sdi_last" "sdi_last"} \
{"sdi" "sdi"} \
{"ibi_ready" "ibi_ready"} \
{"ibi_valid" "ibi_valid"} \
{"ibi" "ibi"} \
}
adi_add_bus_clock "clk" "sdio" "reset_n"
adi_add_bus "offload_sdi" "master" \
"xilinx.com:interface:axis_rtl:1.0" \
"xilinx.com:interface:axis:1.0" \
{
{"offload_sdi_ready" "TREADY"} \
{"offload_sdi_valid" "TVALID"} \
{"offload_sdi" "TDATA"} \
}
adi_add_bus_clock "clk" "offload_sdi" "reset_n" "master"
adi_add_bus "cmdp" "master" \
"analog.com:interface:i3c_controller_cmdp_rtl:1.0" \
"analog.com:interface:i3c_controller_cmdp:1.0" \
{
{"cmdp_valid" "cmdp_valid"} \
{"cmdp_ready" "cmdp_ready"} \
{"cmdp" "cmdp"} \
{"cmdp_error" "cmdp_error"} \
{"cmdp_nop" "cmdp_nop"} \
{"cmdp_daa_trigger" "cmdp_daa_trigger"} \
}
adi_add_bus_clock "clk" "cmdp" "reset_n"
adi_add_bus "rmap" "master" \
"analog.com:interface:i3c_controller_rmap_rtl:1.0" \
"analog.com:interface:i3c_controller_rmap:1.0" \
{
{"rmap_ibi_config" "rmap_ibi_config"} \
{"rmap_pp_sg" "rmap_pp_sg"} \
{"rmap_dev_char_addr" "rmap_dev_char_addr"} \
{"rmap_dev_char_data" "rmap_dev_char_data"} \
}
adi_add_bus_clock "clk" "rmap" "reset_n" "master"
adi_set_ports_dependency "clk" \
"(spirit:decode(id('MODELPARAM_VALUE.ASYNC_CLK')) = 1)"
adi_set_bus_dependency "offload_sdi" "offload_sdi" \
"(spirit:decode(id('MODELPARAM_VALUE.OFFLOAD')) = 1)"
adi_set_ports_dependency "offload_trigger" \
"(spirit:decode(id('MODELPARAM_VALUE.OFFLOAD')) = 1)" 0
set cc [ipx::current_core]
## ID
set_property -dict [list \
"value_validation_type" "range_long" \
"value_validation_range_minimum" "0" \
"value_validation_range_maximum" "255" \
] \
[ipx::get_user_parameters ID -of_objects $cc]
foreach {k v} { \
"ASYNC_CLK" "false" \
"OFFLOAD" "false" \
} { \
set_property -dict [list \
"value_format" "bool" \
"value" $v \
] \
[ipx::get_user_parameters $k -of_objects $cc]
set_property -dict [list \
"value_format" "bool" \
"value" $v \
] \
[ipx::get_hdl_parameters $k -of_objects $cc]
}
## Customize IP Layout
## Remove the automatically generated GUI page
ipgui::remove_page -component $cc [ipgui::get_pagespec -name "Page 0" -component $cc]
ipx::save_core [ipx::current_core]
## Create general configuration page
ipgui::add_page -name {I3C Controller Host Interface} -component [ipx::current_core] -display_name {AXI I3C Controller Host Interface}
set page0 [ipgui::get_pagespec -name "I3C Controller Host Interface" -component $cc]
set general_group [ipgui::add_group -name "General Configuration" -component $cc \
-parent $page0 -display_name "General Configuration" ]
ipgui::add_param -name "ID" -component $cc -parent $general_group
set_property -dict [list \
"display_name" "Core ID" \
"tooltip" "\[ID\] Core instance ID" \
] [ipgui::get_guiparamspec -name "ID" -component $cc]
ipgui::add_param -name "ASYNC_CLK" -component $cc -parent $general_group
set_property -dict [list \
"display_name" "Asynchronous core clock" \
"tooltip" "\[ASYNC_CLK\] Define the relationship between the core clock and the memory mapped interface clock" \
] [ipgui::get_guiparamspec -name "ASYNC_CLK" -component $cc]
ipgui::add_param -name "OFFLOAD" -component $cc -parent $general_group
set_property -dict [list \
"display_name" "Offload engine" \
"tooltip" "\[OFFLOAD\] Allows to offload output data to a external receiver, like a DMA" \
] [ipgui::get_guiparamspec -name "OFFLOAD" -component $cc]
## Create and save the XGUI file
ipx::create_xgui_files $cc
ipx::save_core $cc
@@ -0,0 +1,111 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
/**
* Packs u8 stream into u32.
* Restrictions:
* At partial payload, e.g. 3-bytes, the remaining byte value is unknown.
*/
`timescale 1ns/100ps
module i3c_controller_pack (
input clk,
input reset_n,
input u32_ready,
output u32_valid,
output [31:0] u32,
output [11:0] u8_lvl,
output u8_ready,
input u8_valid,
input u8_last,
input [7:0] u8
);
localparam [0:0] SM_GET = 0;
localparam [0:0] SM_PUT = 1;
reg [0:0] sm;
reg [1:0] c;
reg [7:0] u32_reg [3:0];
reg [11:0] u8_lvl_reg;
reg u8_last_reg;
always @(posedge clk) begin
if (!reset_n) begin
sm <= SM_GET;
c <= 2'b00;
u8_last_reg <= 1'b0;
u8_lvl_reg <= 0;
end else begin
case (sm)
SM_GET: begin
u8_last_reg <= u8_last;
if (u8_valid) begin // tick
u32_reg[3-c] <= u8;
u8_lvl_reg <= u8_lvl_reg + 1;
c <= c + 1;
if (c == 2'b11 | u8_last) begin
c <= 2'b00;
sm <= SM_PUT;
end
end
end
SM_PUT: begin
if (u32_ready) begin
sm <= SM_GET;
if (u8_last_reg) begin
u8_lvl_reg <= 0;
end
end
end
endcase
end
end
assign u8_ready = sm == SM_GET & reset_n;
assign u32_valid = sm == SM_PUT;
assign u8_lvl = u8_lvl_reg;
genvar i;
generate
for (i=0; i<4; i=i+1) begin: gen_u32
assign u32[8*i+7:8*i] = u32_reg[3-i];
end
endgenerate
endmodule
@@ -0,0 +1,747 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`timescale 1ns/100ps
`include "i3c_controller_regmap.vh"
`define ADDRESS_WIDTH 8
module i3c_controller_regmap #(
parameter ID = 0,
parameter ASYNC_CLK = 0,
parameter OFFLOAD = 1,
parameter DATA_WIDTH = 32
) (
// Slave AXI interface
input s_axi_aclk,
input s_axi_aresetn,
input s_axi_awvalid,
input [15:0] s_axi_awaddr,
output s_axi_awready,
input [2:0] s_axi_awprot,
input s_axi_wvalid,
input [31:0] s_axi_wdata,
input [ 3:0] s_axi_wstrb,
output s_axi_wready,
output s_axi_bvalid,
output [ 1:0] s_axi_bresp,
input s_axi_bready,
input s_axi_arvalid,
input [15:0] s_axi_araddr,
output s_axi_arready,
input [2:0] s_axi_arprot,
output s_axi_rvalid,
input s_axi_rready,
output [ 1:0] s_axi_rresp,
output [31:0] s_axi_rdata,
output reg irq,
// Core basic signals
input clk,
output a_reset_n,
// I3C control signals
input cmd_ready,
input cmd_nop,
output cmd_valid,
output [DATA_WIDTH-1:0] cmd,
output cmdr_ready,
input cmdr_valid,
input [DATA_WIDTH-1:0] cmdr,
input sdo_ready,
output sdo_valid,
output [DATA_WIDTH-1:0] sdo,
output sdi_ready,
input sdi_valid,
input [DATA_WIDTH-1:0] sdi,
input offload_sdi_ready,
output offload_sdi_valid,
output [DATA_WIDTH-1:0] offload_sdi,
output ibi_ready,
input ibi_valid,
input [DATA_WIDTH-1:0] ibi,
input daa_trigger,
input offload_trigger,
// uP accessible info
output reg [1:0] rmap_ibi_config,
output [1:0] rmap_pp_sg,
input [6:0] rmap_dev_char_addr,
output [3:0] rmap_dev_char_data
);
localparam PCORE_VERSION = 'h00000100;
reg [31:0] up_scratch = 32'h00; // Scratch register
reg up_sw_reset = 1'b1;
reg [31:0] up_rdata_ff = 32'd0;
reg up_wack_ff = 1'b0;
reg up_rack_ff = 1'b0;
// Holds DAA trigger High until sdo_fifo_empty goes Low,
// meaning DA got written.
reg daa_trigger_lock;
reg daa_pending;
reg cmdr_pending;
reg ibi_pending;
reg [`I3C_REGMAP_IRQ_WIDTH:0] up_irq_mask = 8'h0;
reg [6:0] ops;
reg [6:0] ops_candidate;
reg [6:0] dev_char_addr_reg;
// CMD FIFO
wire [`ADDRESS_WIDTH-1:0] cmd_fifo_room;
wire cmd_fifo_almost_empty;
wire up_cmd_fifo_almost_empty;
wire [DATA_WIDTH-1:0] cmd_fifo_data;
wire cmd_fifo_ready;
wire cmd_fifo_valid;
// CMDR FIFO
wire cmdr_fifo_data_msb_s;
wire [`ADDRESS_WIDTH-1:0] cmdr_fifo_level;
wire cmdr_fifo_almost_full;
wire up_cmdr_fifo_almost_full;
wire [DATA_WIDTH-1:0] cmdr_fifo_data;
wire cmdr_fifo_ready;
wire cmdr_fifo_valid;
wire cmdr_fifo_empty;
// SDO FIFO
wire [`ADDRESS_WIDTH-1:0] sdo_fifo_room;
wire sdo_fifo_almost_empty;
wire up_sdo_fifo_almost_empty;
wire [DATA_WIDTH-1:0] sdo_fifo_data;
wire sdo_fifo_ready;
wire sdo_fifo_valid;
wire sdo_fifo_empty;
// SDI FIFO
wire sdi_fifo_data_msb_s;
wire [`ADDRESS_WIDTH-1:0] sdi_fifo_level;
wire sdi_fifo_almost_full;
wire up_sdi_fifo_almost_full;
wire [DATA_WIDTH-1:0] sdi_fifo_data;
wire sdi_fifo_ready;
wire sdi_fifo_valid;
wire sdi_fifo_empty;
// IBI FIFO
wire ibi_fifo_data_msb_s;
wire [`ADDRESS_WIDTH-1:0] ibi_fifo_level;
wire ibi_fifo_almost_full;
wire up_ibi_fifo_almost_full;
wire [DATA_WIDTH-1:0] ibi_fifo_data;
wire ibi_fifo_ready;
wire ibi_fifo_valid;
wire ibi_fifo_empty;
wire up_sw_resetn = ~up_sw_reset;
wire [31:0] up_rdata_ff_w;
wire up_wreq_s;
wire up_rreq_s;
wire [31:0] up_wdata_s;
wire [13:0] up_waddr_s;
wire [13:0] up_raddr_s;
wire up_cmd_nop;
// IRQ handling
wire [`I3C_REGMAP_IRQ_WIDTH:0] up_irq_source;
wire [`I3C_REGMAP_IRQ_WIDTH:0] up_irq_pending;
wire ops_mode;
wire [3:0] ops_offload_len;
wire [1:0] ops_sg;
wire offload_idle;
wire [31:0] cmd_w;
wire cmd_valid_w;
wire cmd_ready_w;
wire [6:0] dev_char_addr;
wire dev_char_w;
wire dev_char_wea;
wire dev_char_rea;
wire dev_char_ea;
wire [3:0] dev_char_wdata;
wire [3:0] dev_char_rdata;
// Offload mode
wire [31:0] offload_douta;
wire [31:0] offload_cmd;
wire [31:0] offload_sdo;
wire offload_cmd_valid;
wire offload_sdo_valid;
wire clk_1;
wire cmdr_valid_w;
wire cmdr_ready_w;
wire [31:0] sdo_w;
wire sdo_valid_w;
wire sdo_ready_w;
// Interface wrapper
up_axi #(
.AXI_ADDRESS_WIDTH (16)
) i_up_axi (
.up_rstn(s_axi_aresetn),
.up_clk(s_axi_aclk),
.up_axi_awvalid(s_axi_awvalid),
.up_axi_awaddr(s_axi_awaddr),
.up_axi_awready(s_axi_awready),
.up_axi_wvalid(s_axi_wvalid),
.up_axi_wdata(s_axi_wdata),
.up_axi_wstrb(s_axi_wstrb),
.up_axi_wready(s_axi_wready),
.up_axi_bvalid(s_axi_bvalid),
.up_axi_bresp(s_axi_bresp),
.up_axi_bready(s_axi_bready),
.up_axi_arvalid(s_axi_arvalid),
.up_axi_araddr(s_axi_araddr),
.up_axi_arready(s_axi_arready),
.up_axi_rvalid(s_axi_rvalid),
.up_axi_rresp(s_axi_rresp),
.up_axi_rdata(s_axi_rdata),
.up_axi_rready(s_axi_rready),
.up_wreq(up_wreq_s),
.up_waddr(up_waddr_s),
.up_wdata(up_wdata_s),
.up_wack(up_wack_ff),
.up_rreq(up_rreq_s),
.up_raddr(up_raddr_s),
.up_rdata(up_rdata_ff_w),
.up_rack(up_rack_ff));
assign up_irq_source = {
daa_pending,
ibi_pending,
cmdr_pending,
up_ibi_fifo_almost_full,
up_sdi_fifo_almost_full,
up_sdo_fifo_almost_empty,
up_cmdr_fifo_almost_full,
up_cmd_fifo_almost_empty
};
assign up_irq_pending = up_irq_mask & up_irq_source;
always @(posedge s_axi_aclk) begin
if (s_axi_aresetn == 1'b0) begin
irq <= 1'b0;
end else begin
irq <= |up_irq_pending;
end
end
always @(posedge s_axi_aclk) begin
if (s_axi_aresetn == 1'b0) begin
up_wack_ff <= 1'b0;
up_scratch <= 32'h0;
up_sw_reset <= 1'b1;
end else begin
up_wack_ff <= up_wreq_s;
if (up_wreq_s) begin
case (up_waddr_s[7:0])
`I3C_REGMAP_ENABLE: up_sw_reset <= up_wdata_s[0];
`I3C_REGMAP_SCRATCH: up_scratch <= up_wdata_s;
endcase
end
end
end
assign ops_mode = ops[0];
assign ops_offload_len = ops[4:1];
assign ops_sg = ops[6:5];
assign rmap_pp_sg = ops_sg;
always @(posedge s_axi_aclk) begin
if (!up_sw_resetn) begin
ops <= 7'b1100000;
end else if (up_cmd_nop) begin
if ((~ops_mode & ~cmd_valid_w) | (ops_mode & offload_idle)) begin
ops <= ops_candidate;
end
end
end
// the software reset should reset all the registers
integer i;
always @(posedge s_axi_aclk) begin
if (!up_sw_resetn) begin
up_irq_mask <= 8'h0;
rmap_ibi_config <= 2'h0;
ops_candidate <= 7'd0;
end else begin
if (up_wreq_s) begin
case (up_waddr_s[7:0])
`I3C_REGMAP_IRQ_MASK: up_irq_mask <= up_wdata_s[`I3C_REGMAP_IRQ_WIDTH:0];
`I3C_REGMAP_IBI_CONFIG: rmap_ibi_config <= up_wdata_s[1:0];
`I3C_REGMAP_OPS: ops_candidate <= up_wdata_s[6:0];
default: begin
end
endcase
end
end
end
always @(posedge s_axi_aclk) begin
if (s_axi_aresetn == 1'b0) begin
up_rack_ff <= 1'd0;
end else begin
up_rack_ff <= up_rreq_s;
end
end
always @(posedge s_axi_aclk) begin
case (up_raddr_s[7:0])
`I3C_REGMAP_VERSION: up_rdata_ff <= PCORE_VERSION;
`I3C_REGMAP_DEVICE_ID: up_rdata_ff <= ID;
`I3C_REGMAP_SCRATCH: up_rdata_ff <= up_scratch;
`I3C_REGMAP_ENABLE: up_rdata_ff <= up_sw_reset;
`I3C_REGMAP_IRQ_MASK: up_rdata_ff <= up_irq_mask;
`I3C_REGMAP_IRQ_PENDING: up_rdata_ff <= up_irq_pending;
`I3C_REGMAP_IRQ_SOURCE: up_rdata_ff <= up_irq_source;
`I3C_REGMAP_CMD_FIFO_ROOM: up_rdata_ff <= cmd_fifo_room;
`I3C_REGMAP_CMDR_FIFO_LEVEL:up_rdata_ff <= cmdr_fifo_level;
`I3C_REGMAP_SDO_FIFO_ROOM: up_rdata_ff <= sdo_fifo_room;
`I3C_REGMAP_SDI_FIFO_LEVEL: up_rdata_ff <= sdi_fifo_level;
`I3C_REGMAP_IBI_FIFO_LEVEL: up_rdata_ff <= ibi_fifo_level;
`I3C_REGMAP_CMDR_FIFO: up_rdata_ff <= cmdr_fifo_data;
`I3C_REGMAP_SDI_FIFO: up_rdata_ff <= sdi_fifo_data;
`I3C_REGMAP_IBI_FIFO: up_rdata_ff <= ibi_fifo_data;
`I3C_REGMAP_FIFO_STATUS: up_rdata_ff <= {sdi_fifo_empty, ibi_fifo_empty, cmdr_fifo_empty};
`I3C_REGMAP_OPS: up_rdata_ff <= {cmd_nop, ops};
default: up_rdata_ff <= 32'h0;
endcase
end
assign up_rdata_ff_w = up_raddr_s[7:0] == `I3C_REGMAP_DEV_CHAR ? {16'b0, dev_char_addr, 5'b0, dev_char_rdata} :
up_raddr_s[7:4] == `I3C_REGMAP_OFFLOAD_CMD_ ? offload_douta :
up_raddr_s[7:4] == `I3C_REGMAP_OFFLOAD_SDO_ ? offload_douta :
~|up_raddr_s[3:0] ? up_rdata_ff :
up_rdata_ff;
ad_mem_dual #(
.INITIALIZE(1),
.DATA_WIDTH(4),
.ADDRESS_WIDTH(7)
) i_mem_dev_char (
.clka(s_axi_aclk),
.wea(dev_char_wea),
.ea(1'b1),
.addra(dev_char_addr),
.dina(dev_char_wdata),
.douta(dev_char_rdata),
.clkb(s_axi_aclk),
.web(1'b0),
.eb(1'b1),
.addrb(rmap_dev_char_addr),
.dinb(),
.doutb(rmap_dev_char_data));
always @(posedge s_axi_aclk) begin
if (dev_char_w) begin
dev_char_addr_reg <= dev_char_addr;
end
end
assign dev_char_wdata = up_wdata_s[3:0];
assign dev_char_addr = dev_char_w ? up_wdata_s[15:9] : dev_char_addr_reg;
assign dev_char_rea = up_rreq_s == 1'b1 && (up_raddr_s[7:0] == `I3C_REGMAP_DEV_CHAR);
assign dev_char_w = up_wreq_s == 1'b1 && (up_waddr_s[7:0] == `I3C_REGMAP_DEV_CHAR);
assign dev_char_wea = dev_char_w && up_wdata_s[8];
assign dev_char_ea = dev_char_rea | dev_char_wea;
generate if (OFFLOAD) begin
localparam [1:0] SM_CMD_GET = 0;
localparam [1:0] SM_CMD_PUT = 1;
localparam [1:0] SM_SDO_GET = 2;
localparam [1:0] SM_SDO_PUT = 3;
reg [1:0] sm;
reg [3:0] k;
reg [3:0] j;
reg [9:0] offload_sdo_buffer_len;
wire offload_ea;
wire offload_wea;
wire offload_rea;
wire [4:0] offload_addra;
wire offload_eb;
wire [4:0] offload_addrb;
wire [31:0] offload_doutb;
ad_mem_dual #(
.DATA_WIDTH(32),
.ADDRESS_WIDTH(5)
) i_mem_offload (
.clka(s_axi_aclk),
.wea(offload_wea),
.ea(offload_ea),
.addra(offload_addra),
.dina(up_wdata_s),
.douta(offload_douta),
.clkb(s_axi_aclk),
.web(1'b0),
.eb(offload_eb),
.addrb(offload_addrb),
.dinb('d0),
.doutb(offload_doutb));
assign offload_addra = up_wreq_s ?
{up_waddr_s[6], up_waddr_s[3:0]} :
{up_raddr_s[6], up_raddr_s[3:0]};
assign offload_rea = up_rreq_s == 1'b1 &&
(up_raddr_s[7:4] == `I3C_REGMAP_OFFLOAD_CMD_ |
up_raddr_s[7:4] == `I3C_REGMAP_OFFLOAD_SDO_ );
assign offload_wea = up_wreq_s == 1'b1 &&
(up_waddr_s[7:4] == `I3C_REGMAP_OFFLOAD_CMD_ |
up_waddr_s[7:4] == `I3C_REGMAP_OFFLOAD_SDO_ );
assign offload_ea = offload_rea | offload_wea;
always @(posedge s_axi_aclk) begin
if (!a_reset_n | ~ops_mode | ops_offload_len == 0) begin
offload_sdo_buffer_len <= 0;
sm <= SM_CMD_GET;
k <= 'd0;
end else begin
// The same BRAM provides both cmd and sdo,
// therefore a request-like interface is used.
if (sm[1] == 1'b0) begin
j <= 0;
end
case (sm)
SM_CMD_GET: begin
if (offload_trigger | k != 0) begin
sm <= SM_CMD_PUT;
k <= k == ops_offload_len - 1 ? 0 : k + 1;
end
end
SM_CMD_PUT: begin
if (cmd_ready) begin
sm <= SM_SDO_GET;
if (~cmd[0]) begin
offload_sdo_buffer_len <= cmd[19:10] + {9'd0, |cmd[9:8]};
end
end
end
SM_SDO_GET: begin
sm <= SM_SDO_PUT;
j <= j + 1;
end
SM_SDO_PUT: begin
// New payload requested, check if is cmd or sdo.
if (cmd_ready) begin
sm <= SM_CMD_GET;
end else if (sdo_ready) begin
if (|offload_sdo_buffer_len) begin
offload_sdo_buffer_len <= offload_sdo_buffer_len - 1;
end
sm <= SM_SDO_GET;
end
end
endcase
end
end
assign offload_idle = sm == SM_CMD_GET & k == 0;
assign offload_addrb = sm[1] == 1'b0 ? {1'b0,k} : {1'b1,j};
assign offload_eb = sm[0] == 1'b0 & ops_mode;
assign offload_cmd_valid = sm == SM_CMD_PUT;
assign offload_sdo_valid = sm == SM_SDO_PUT & |offload_sdo_buffer_len;
assign offload_cmd = offload_doutb;
assign offload_sdo = offload_doutb;
end
endgenerate
always @(posedge s_axi_aclk) begin
if (up_sw_resetn == 1'b0) begin
daa_trigger_lock <= 1'b0;
daa_pending <= 1'b0;
cmdr_pending <= 1'b0;
ibi_pending <= 1'b0;
end else begin
if (cmdr_fifo_valid == 1'b1) begin
cmdr_pending <= 1'b1;
end else if (up_wreq_s == 1'b1 &&
up_waddr_s[7:0] == `I3C_REGMAP_IRQ_PENDING &&
up_wdata_s[`I3C_REGMAP_IRQ_CMDR_PENDING] == 1'b1) begin
cmdr_pending <= 1'b0;
end
if (ibi_fifo_valid == 1'b1) begin
ibi_pending <= 1'b1;
end else if (up_wreq_s == 1'b1 &&
up_waddr_s[7:0] == `I3C_REGMAP_IRQ_PENDING &&
up_wdata_s[`I3C_REGMAP_IRQ_IBI_PENDING] == 1'b1) begin
ibi_pending <= 1'b0;
end
if (daa_trigger_lock == 1'b1) begin
daa_pending <= 1'b1;
end else if (up_wreq_s == 1'b1 &&
up_waddr_s[7:0] == `I3C_REGMAP_IRQ_PENDING &&
up_wdata_s[`I3C_REGMAP_IRQ_DAA_PENDING] == 1'b1) begin
daa_pending <= 1'b0;
end
if (daa_trigger) begin
daa_trigger_lock <= 1'b1;
end else if (sdo_valid_w) begin
daa_trigger_lock <= 1'b0;
end
end
end
generate if (ASYNC_CLK) begin
wire a_reset;
ad_rst i_resetn (
.rst_async(up_sw_reset),
.clk(clk),
.rst(a_reset),
.rstn());
assign a_reset_n = ~a_reset;
assign clk_1 = clk;
end else begin /* ASYNC_CLK == 0 */
assign a_reset_n = ~up_sw_reset;
assign clk_1 = s_axi_aclk;
end
endgenerate
assign cmd = ~ops_mode ? cmd_w : offload_cmd;
assign cmd_valid = ~ops_mode ? cmd_valid_w : offload_cmd_valid;
assign cmd_ready_w = ~ops_mode ? cmd_ready : 1'b0;
assign cmd_fifo_valid = up_wreq_s == 1'b1 && up_waddr_s[7:0] == `I3C_REGMAP_CMD_FIFO;
assign cmd_fifo_data = up_wdata_s;
util_axis_fifo #(
.DATA_WIDTH(DATA_WIDTH),
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
.ASYNC_CLK(ASYNC_CLK),
.M_AXIS_REGISTERED(0),
.ALMOST_EMPTY_THRESHOLD(1),
.ALMOST_FULL_THRESHOLD(1)
) i_cmd_fifo (
.s_axis_aclk(s_axi_aclk),
.s_axis_aresetn(up_sw_resetn),
.s_axis_ready(cmd_fifo_ready),
.s_axis_valid(cmd_fifo_valid),
.s_axis_data(cmd_fifo_data),
.s_axis_room(cmd_fifo_room),
.s_axis_tlast(1'b0),
.s_axis_full(),
.s_axis_almost_full(),
.m_axis_aclk(clk_1),
.m_axis_aresetn(a_reset_n),
.m_axis_ready(cmd_ready_w),
.m_axis_valid(cmd_valid_w),
.m_axis_data(cmd_w),
.m_axis_tlast(),
.m_axis_empty(),
.m_axis_almost_empty(cmd_fifo_almost_empty),
.m_axis_level());
assign cmdr_ready = ~ops_mode ? cmdr_ready_w : 1'b1; // In offload, discard cmdr
assign cmdr_valid_w = ~ops_mode ? cmdr_valid : 1'b0;
assign cmdr_fifo_ready = up_rreq_s == 1'b1 && up_raddr_s[7:0] == `I3C_REGMAP_CMDR_FIFO;
util_axis_fifo #(
.DATA_WIDTH(DATA_WIDTH),
.ASYNC_CLK(ASYNC_CLK),
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
.M_AXIS_REGISTERED(0),
.ALMOST_EMPTY_THRESHOLD(1),
.ALMOST_FULL_THRESHOLD(31)
) i_cmdr_fifo (
.s_axis_aclk(clk_1),
.s_axis_aresetn(a_reset_n),
.s_axis_ready(cmdr_ready_w),
.s_axis_valid(cmdr_valid_w),
.s_axis_data(cmdr),
.s_axis_room(),
.s_axis_tlast(),
.s_axis_full(),
.s_axis_almost_full(cmdr_fifo_almost_full),
.m_axis_aclk(s_axi_aclk),
.m_axis_aresetn(up_sw_resetn),
.m_axis_ready(cmdr_fifo_ready),
.m_axis_valid(cmdr_fifo_valid),
.m_axis_data(cmdr_fifo_data),
.m_axis_tlast(),
.m_axis_level(cmdr_fifo_level),
.m_axis_empty(cmdr_fifo_empty),
.m_axis_almost_empty());
assign sdo = ~ops_mode ? sdo_w : offload_sdo;
assign sdo_valid = ~ops_mode ? sdo_valid_w : offload_sdo_valid;
assign sdo_ready_w = ~ops_mode ? sdo_ready : 1'b0;
assign sdo_fifo_valid = up_wreq_s == 1'b1 && up_waddr_s[7:0] == `I3C_REGMAP_SDO_FIFO;
assign sdo_fifo_data = up_wdata_s[31:0];
util_axis_fifo #(
.DATA_WIDTH(DATA_WIDTH),
.ASYNC_CLK(ASYNC_CLK),
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
.M_AXIS_REGISTERED(0),
.ALMOST_EMPTY_THRESHOLD(1),
.ALMOST_FULL_THRESHOLD(1)
) i_sdo_fifo (
.s_axis_aclk(s_axi_aclk),
.s_axis_aresetn(up_sw_resetn),
.s_axis_ready(sdo_fifo_ready),
.s_axis_valid(sdo_fifo_valid),
.s_axis_data(sdo_fifo_data),
.s_axis_room(sdo_fifo_room),
.s_axis_tlast(1'b0),
.s_axis_full(),
.s_axis_almost_full(),
.m_axis_aclk(clk_1),
.m_axis_aresetn(a_reset_n),
.m_axis_ready(sdo_ready_w),
.m_axis_valid(sdo_valid_w),
.m_axis_data(sdo_w),
.m_axis_tlast(),
.m_axis_level(),
.m_axis_empty(sdo_fifo_empty),
.m_axis_almost_empty(sdo_fifo_almost_empty));
wire sdi_valid_w;
wire sdi_ready_w;
assign offload_sdi = sdi;
assign offload_sdi_valid = ops_mode ? sdi_valid : 1'b0;
assign sdi_valid_w = ~ops_mode ? sdi_valid : 1'b0;
assign sdi_ready = ops_mode ? offload_sdi_ready : sdi_ready_w;
assign sdi_fifo_ready = up_rreq_s == 1'b1 && up_raddr_s[7:0] == `I3C_REGMAP_SDI_FIFO;
util_axis_fifo #(
.DATA_WIDTH(DATA_WIDTH),
.ASYNC_CLK(ASYNC_CLK),
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
.M_AXIS_REGISTERED(0),
.ALMOST_EMPTY_THRESHOLD(1),
.ALMOST_FULL_THRESHOLD(31)
) i_sdi_fifo (
.s_axis_aclk(clk_1),
.s_axis_aresetn(a_reset_n),
.s_axis_ready(sdi_ready_w),
.s_axis_valid(sdi_valid_w),
.s_axis_data(sdi),
.s_axis_room(),
.s_axis_tlast(),
.s_axis_full(),
.s_axis_almost_full(sdi_fifo_almost_full),
.m_axis_aclk(s_axi_aclk),
.m_axis_aresetn(up_sw_resetn),
.m_axis_ready(sdi_fifo_ready),
.m_axis_valid(sdi_fifo_valid),
.m_axis_data(sdi_fifo_data),
.m_axis_tlast(),
.m_axis_level(sdi_fifo_level),
.m_axis_empty(sdi_fifo_empty),
.m_axis_almost_empty());
assign ibi_fifo_ready = up_rreq_s == 1'b1 && up_raddr_s[7:0] == `I3C_REGMAP_IBI_FIFO;
util_axis_fifo #(
.DATA_WIDTH(DATA_WIDTH),
.ASYNC_CLK(ASYNC_CLK),
.ADDRESS_WIDTH(`ADDRESS_WIDTH),
.M_AXIS_REGISTERED(0),
.ALMOST_EMPTY_THRESHOLD(1),
.ALMOST_FULL_THRESHOLD(31)
) i_ibi_fifo (
.s_axis_aclk(clk_1),
.s_axis_aresetn(a_reset_n),
.s_axis_ready(ibi_ready),
.s_axis_valid(ibi_valid),
.s_axis_data(ibi),
.s_axis_room(),
.s_axis_tlast(),
.s_axis_full(),
.s_axis_almost_full(ibi_fifo_almost_full),
.m_axis_aclk(s_axi_aclk),
.m_axis_aresetn(up_sw_resetn),
.m_axis_ready(ibi_fifo_ready),
.m_axis_valid(ibi_fifo_valid),
.m_axis_data(ibi_fifo_data),
.m_axis_tlast(),
.m_axis_level(ibi_fifo_level),
.m_axis_empty(ibi_fifo_empty),
.m_axis_almost_empty());
sync_bits #(
.NUM_OF_BITS (6),
.ASYNC_CLK (ASYNC_CLK)
) i_fifo_status (
.in_bits ({
cmd_fifo_almost_empty, cmdr_fifo_almost_full, sdo_fifo_almost_empty,
sdi_fifo_almost_full, ibi_fifo_almost_full, cmd_nop
}),
.out_resetn (up_sw_resetn),
.out_clk (s_axi_aclk),
.out_bits ({up_cmd_fifo_almost_empty, up_cmdr_fifo_almost_full,
up_sdo_fifo_almost_empty, up_sdi_fifo_almost_full, up_ibi_fifo_almost_full,
up_cmd_nop
}));
endmodule
@@ -0,0 +1,68 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`ifndef I3C_CONTROLLER_REGMAP_V
`define I3C_CONTROLLER_REGMAP_V
`define I3C_REGMAP_VERSION 8'h00
`define I3C_REGMAP_DEVICE_ID 8'h01
`define I3C_REGMAP_SCRATCH 8'h02
`define I3C_REGMAP_ENABLE 8'h10
`define I3C_REGMAP_IRQ_MASK 8'h20
`define I3C_REGMAP_IRQ_PENDING 8'h21
`define I3C_REGMAP_IRQ_SOURCE 8'h22
`define I3C_REGMAP_CMD_FIFO_ROOM 8'h30
`define I3C_REGMAP_CMDR_FIFO_LEVEL 8'h31
`define I3C_REGMAP_SDO_FIFO_ROOM 8'h32
`define I3C_REGMAP_SDI_FIFO_LEVEL 8'h33
`define I3C_REGMAP_IBI_FIFO_LEVEL 8'h34
`define I3C_REGMAP_CMD_FIFO 8'h35
`define I3C_REGMAP_CMDR_FIFO 8'h36
`define I3C_REGMAP_SDO_FIFO 8'h37
`define I3C_REGMAP_SDI_FIFO 8'h38
`define I3C_REGMAP_IBI_FIFO 8'h39
`define I3C_REGMAP_FIFO_STATUS 8'h3a
`define I3C_REGMAP_OPS 8'h40
`define I3C_REGMAP_IBI_CONFIG 8'h50
`define I3C_REGMAP_DEV_CHAR 8'h60
`define I3C_REGMAP_OFFLOAD_CMD_ 4'hb
`define I3C_REGMAP_OFFLOAD_SDO_ 4'hc
`define I3C_REGMAP_IRQ_WIDTH 7
`define I3C_REGMAP_IRQ_CMDR_PENDING 5
`define I3C_REGMAP_IRQ_IBI_PENDING 6
`define I3C_REGMAP_IRQ_DAA_PENDING 7
`endif
@@ -0,0 +1,98 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
/**
* Unpacks u32 packages into u8 stream.
*/
`timescale 1ns/100ps
module i3c_controller_unpack (
input clk,
input reset_n,
input stop,
output u32_ready,
input u32_valid,
input [31:0] u32,
output [11:0] u8_lvl,
input u8_ready,
output u8_valid,
output [7:0] u8
);
localparam [0:0] SM_GET = 0;
localparam [0:0] SM_PUT = 1;
reg [0:0] sm;
reg [1:0] c;
reg [11:0] u8_lvl_reg;
reg [31:0] u32_reg;
always @(posedge clk) begin
if (!reset_n | stop) begin
sm <= SM_GET;
c <= 2'b00;
u8_lvl_reg <= 0;
end else begin
case (sm)
SM_GET: begin
if (u32_valid) begin
sm <= SM_PUT;
end
u32_reg <= u32;
c <= 2'b00;
end
SM_PUT: begin
if (u8_ready) begin // tick
u8_lvl_reg <= u8_lvl_reg + 12'b1;
c <= c + 1;
if (c == 2'b11) begin
sm <= SM_GET;
end
u32_reg <= u32_reg >> 8;
end
end
endcase
end
end
assign u32_ready = sm == SM_GET & (reset_n | stop);
assign u8_valid = sm == SM_PUT;
assign u8_lvl = u8_lvl_reg;
assign u8 = u32_reg[7:0];
endmodule
@@ -0,0 +1,82 @@
// ***************************************************************************
// ***************************************************************************
// Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of various HDL (Verilog or VHDL) components. The individual modules are
// developed independently, and may be accompanied by separate and unique license
// terms.
//
// The user should read each of these license terms, and understand the
// freedoms and responsibilities that he or she has by using this source/core.
//
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE.
//
// Redistribution and use of source or resulting binaries, with or without modification
// of this file, are permitted under one of the following two license terms:
//
// 1. The GNU General Public License version 2 as published by the
// Free Software Foundation, which can be found in the top level directory
// of this repository (LICENSE_GPL2), and also online at:
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
//
// OR
//
// 2. An ADI specific BSD license, which can be found in the top level directory
// of this repository (LICENSE_ADIBSD), and also on-line at:
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
// This will allow to generate bit files and not release the source code,
// as long as it attaches to an ADI device.
//
// ***************************************************************************
// ***************************************************************************
`timescale 1ns/100ps
module i3c_controller_write_ibi (
input clk,
input reset_n,
input out_ready,
output out_valid,
output [31:0] out,
output in_ready,
input in_valid,
input [14:0] in
);
reg [0:0] sm;
reg [6:0] da;
reg [7:0] mdb;
reg [7:0] sync;
localparam [0:0] SM_GET = 0;
localparam [0:0] SM_PUT = 1;
always @(posedge clk) begin
if (!reset_n) begin
sm <= SM_GET;
sync <= 8'd0;
end else begin
case (sm)
SM_GET: begin
sm <= in_valid ? SM_PUT : sm;
da <= in[14:8];
mdb <= in[7:0];
end
SM_PUT: begin
sm <= out_ready ? SM_GET : sm;
sync <= out_ready ? sync+1 : sync;
end
endcase
end
end
assign out = {8'd0, da, 1'b0, mdb, sync};
assign in_ready = sm == SM_GET;
assign out_valid = sm == SM_PUT;
endmodule
@@ -0,0 +1,61 @@
# Definitional proc to organize widgets for parameters.
proc init_gui { IPINST } {
ipgui::add_param $IPINST -name "Component_Name"
#Adding Page
set I3C_Controller_Host_Interface [ipgui::add_page $IPINST -name "I3C Controller Host Interface" -display_name {AXI I3C Controller Host Interface}]
#Adding Group
set General_Configuration [ipgui::add_group $IPINST -name "General Configuration" -parent ${I3C_Controller_Host_Interface}]
set ID [ipgui::add_param $IPINST -name "ID" -parent ${General_Configuration}]
set_property tooltip {[ID] Core instance ID} ${ID}
set ASYNC_CLK [ipgui::add_param $IPINST -name "ASYNC_CLK" -parent ${General_Configuration}]
set_property tooltip {[ASYNC_CLK] Define the relationship between the core clock and the memory mapped interface clock} ${ASYNC_CLK}
set OFFLOAD [ipgui::add_param $IPINST -name "OFFLOAD" -parent ${General_Configuration}]
set_property tooltip {[OFFLOAD] Allows to offload output data to a external receiver, like a DMA} ${OFFLOAD}
}
proc update_PARAM_VALUE.ASYNC_CLK { PARAM_VALUE.ASYNC_CLK } {
# Procedure called to update ASYNC_CLK when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.ASYNC_CLK { PARAM_VALUE.ASYNC_CLK } {
# Procedure called to validate ASYNC_CLK
return true
}
proc update_PARAM_VALUE.ID { PARAM_VALUE.ID } {
# Procedure called to update ID when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.ID { PARAM_VALUE.ID } {
# Procedure called to validate ID
return true
}
proc update_PARAM_VALUE.OFFLOAD { PARAM_VALUE.OFFLOAD } {
# Procedure called to update OFFLOAD when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.OFFLOAD { PARAM_VALUE.OFFLOAD } {
# Procedure called to validate OFFLOAD
return true
}
proc update_MODELPARAM_VALUE.ID { MODELPARAM_VALUE.ID PARAM_VALUE.ID } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.ID}] ${MODELPARAM_VALUE.ID}
}
proc update_MODELPARAM_VALUE.ASYNC_CLK { MODELPARAM_VALUE.ASYNC_CLK PARAM_VALUE.ASYNC_CLK } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.ASYNC_CLK}] ${MODELPARAM_VALUE.ASYNC_CLK}
}
proc update_MODELPARAM_VALUE.OFFLOAD { MODELPARAM_VALUE.OFFLOAD PARAM_VALUE.OFFLOAD } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.OFFLOAD}] ${MODELPARAM_VALUE.OFFLOAD}
}
@@ -0,0 +1,42 @@
####################################################################################
####################################################################################
## Copyright (C) 2024 Analog Devices, Inc.
### SPDX short identifier: BSD-1-Clause
## Auto-generated, do not modify!
####################################################################################
####################################################################################
M_DEPS := interfaces_ip.tcl
M_DEPS += ../../../scripts/adi_env.tcl
M_DEPS += ../../scripts/adi_ip_xilinx.tcl
M_VIVADO := vivado -mode batch -source
XML_FLIST := i3c_controller.xml
XML_FLIST += i3c_controller_rtl.xml
XML_FLIST += i3c_controller_cmdp.xml
XML_FLIST += i3c_controller_cmdp_rtl.xml
XML_FLIST += i3c_controller_rmap.xml
XML_FLIST += i3c_controller_rmap_rtl.xml
XML_FLIST += i3c_controller_sdio.xml
XML_FLIST += i3c_controller_sdio_rtl.xml
M_FLIST := *.log
M_FLIST += *.jou
M_FLIST += $(XML_FLIST)
.PHONY: all xilinx clean clean-all
all: xilinx
xilinx: $(XML_FLIST)
clean:clean-all
clean-all:
rm -rf $(M_FLIST)
%.xml: $(M_DEPS)
$(M_VIVADO) interfaces_ip.tcl >> interfaces_ip.log 2>&1
####################################################################################
####################################################################################
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<spirit:busDefinition xmlns:xilinx="http://www.xilinx.com" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<spirit:vendor>analog.com</spirit:vendor>
<spirit:library>interface</spirit:library>
<spirit:name>i3c_controller</spirit:name>
<spirit:version>1.0</spirit:version>
<spirit:directConnection>false</spirit:directConnection>
<spirit:isAddressable>false</spirit:isAddressable>
<spirit:maxMasters>1</spirit:maxMasters>
<spirit:maxSlaves>1</spirit:maxSlaves>
</spirit:busDefinition>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<spirit:busDefinition xmlns:xilinx="http://www.xilinx.com" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<spirit:vendor>analog.com</spirit:vendor>
<spirit:library>interface</spirit:library>
<spirit:name>i3c_controller_cmdp</spirit:name>
<spirit:version>1.0</spirit:version>
<spirit:directConnection>false</spirit:directConnection>
<spirit:isAddressable>false</spirit:isAddressable>
<spirit:maxMasters>1</spirit:maxMasters>
<spirit:maxSlaves>1</spirit:maxSlaves>
</spirit:busDefinition>
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<spirit:abstractionDefinition xmlns:xilinx="http://www.xilinx.com" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<spirit:vendor>analog.com</spirit:vendor>
<spirit:library>interface</spirit:library>
<spirit:name>i3c_controller_cmdp_rtl</spirit:name>
<spirit:version>1.0</spirit:version>
<spirit:busType spirit:vendor="analog.com" spirit:library="interface" spirit:name="i3c_controller_cmdp" spirit:version="1.0"/>
<spirit:ports>
<spirit:port>
<spirit:logicalName>cmdp_ready</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>cmdp_valid</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>cmdp</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>31</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>31</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>cmdp_error</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>3</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>3</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>cmdp_nop</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>cmdp_daa_trigger</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
</spirit:ports>
</spirit:abstractionDefinition>
@@ -0,0 +1,77 @@
// (c) Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
// (c) Copyright 2022-2024 Advanced Micro Devices, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of AMD and is protected under U.S. and international copyright
// and other intellectual property laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant any
// rights to the materials distributed herewith. Except as
// otherwise provided in a valid license issued to you by
// AMD, and to the maximum extent permitted by applicable
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
// WITH ALL FAULTS, AND AMD HEREBY DISCLAIMS ALL WARRANTIES
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
// (2) AMD shall not be liable (whether in contract or tort,
// including negligence, or under any other theory of
// liability) for any loss or damage of any kind or nature
// related to, arising under or in connection with these
// materials, including for any direct, or any indirect,
// special, incidental, or consequential loss or damage
// (including loss of data, profits, goodwill, or any type of
// loss or damage suffered as a result of any action brought
// by a third party) even if such damage or loss was
// reasonably foreseeable or AMD had been advised of the
// possibility of the same.
//
// CRITICAL APPLICATIONS
// AMD products are not designed or intended to be fail-
// safe, or for use in any application requiring fail-safe
// performance, such as life-support or safety devices or
// systems, Class III medical devices, nuclear facilities,
// applications related to the deployment of airbags, or any
// other applications that could lead to death, personal
// injury, or severe property or environmental damage
// (individually and collectively, "Critical
// Applications"). Customer assumes the sole risk and
// liability of any use of AMD products in Critical
// Applications, subject only to applicable laws and
// regulations governing limitations on product liability.
//
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
// PART OF THIS FILE AT ALL TIMES.
//
// DO NOT MODIFY THIS FILE.
`ifndef i3c_controller_cmdp_v1_0
`define i3c_controller_cmdp_v1_0
interface i3c_controller_cmdp_v1_0();
logic cmdp_ready; //
logic cmdp_valid; //
logic [30:0] cmdp; //
logic [2:0] cmdp_error; //
logic cmdp_nop; //
logic cmdp_daa_trigger; //
modport MASTER (
input cmdp_ready, cmdp_error, cmdp_nop, cmdp_daa_trigger,
output cmdp_valid, cmdp
);
modport SLAVE (
input cmdp_valid, cmdp,
output cmdp_ready, cmdp_error, cmdp_nop, cmdp_daa_trigger
);
modport MONITOR (
input cmdp_ready, cmdp_valid, cmdp, cmdp_error, cmdp_nop, cmdp_daa_trigger
);
endinterface // i3c_controller_cmdp_v1_0
`endif
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<spirit:busDefinition xmlns:xilinx="http://www.xilinx.com" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<spirit:vendor>analog.com</spirit:vendor>
<spirit:library>interface</spirit:library>
<spirit:name>i3c_controller_rmap</spirit:name>
<spirit:version>1.0</spirit:version>
<spirit:directConnection>false</spirit:directConnection>
<spirit:isAddressable>false</spirit:isAddressable>
<spirit:maxMasters>1</spirit:maxMasters>
<spirit:maxSlaves>1</spirit:maxSlaves>
</spirit:busDefinition>
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<spirit:abstractionDefinition xmlns:xilinx="http://www.xilinx.com" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<spirit:vendor>analog.com</spirit:vendor>
<spirit:library>interface</spirit:library>
<spirit:name>i3c_controller_rmap_rtl</spirit:name>
<spirit:version>1.0</spirit:version>
<spirit:busType spirit:vendor="analog.com" spirit:library="interface" spirit:name="i3c_controller_rmap" spirit:version="1.0"/>
<spirit:ports>
<spirit:port>
<spirit:logicalName>rmap_ibi_config</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>2</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>2</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>rmap_pp_sg</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>2</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>2</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>rmap_dev_char_addr</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>7</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>7</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>rmap_dev_char_data</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>4</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>4</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
</spirit:ports>
</spirit:abstractionDefinition>
@@ -0,0 +1,75 @@
// (c) Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
// (c) Copyright 2022-2024 Advanced Micro Devices, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of AMD and is protected under U.S. and international copyright
// and other intellectual property laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant any
// rights to the materials distributed herewith. Except as
// otherwise provided in a valid license issued to you by
// AMD, and to the maximum extent permitted by applicable
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
// WITH ALL FAULTS, AND AMD HEREBY DISCLAIMS ALL WARRANTIES
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
// (2) AMD shall not be liable (whether in contract or tort,
// including negligence, or under any other theory of
// liability) for any loss or damage of any kind or nature
// related to, arising under or in connection with these
// materials, including for any direct, or any indirect,
// special, incidental, or consequential loss or damage
// (including loss of data, profits, goodwill, or any type of
// loss or damage suffered as a result of any action brought
// by a third party) even if such damage or loss was
// reasonably foreseeable or AMD had been advised of the
// possibility of the same.
//
// CRITICAL APPLICATIONS
// AMD products are not designed or intended to be fail-
// safe, or for use in any application requiring fail-safe
// performance, such as life-support or safety devices or
// systems, Class III medical devices, nuclear facilities,
// applications related to the deployment of airbags, or any
// other applications that could lead to death, personal
// injury, or severe property or environmental damage
// (individually and collectively, "Critical
// Applications"). Customer assumes the sole risk and
// liability of any use of AMD products in Critical
// Applications, subject only to applicable laws and
// regulations governing limitations on product liability.
//
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
// PART OF THIS FILE AT ALL TIMES.
//
// DO NOT MODIFY THIS FILE.
`ifndef i3c_controller_rmap_v1_0
`define i3c_controller_rmap_v1_0
interface i3c_controller_rmap_v1_0();
logic [1:0] rmap_ibi_config; //
logic [1:0] rmap_pp_sg; //
logic [6:0] rmap_dev_char_addr; //
logic [3:0] rmap_dev_char_data; //
modport MASTER (
input rmap_dev_char_addr,
output rmap_ibi_config, rmap_pp_sg, rmap_dev_char_data
);
modport SLAVE (
input rmap_ibi_config, rmap_pp_sg, rmap_dev_char_data,
output rmap_dev_char_addr
);
modport MONITOR (
input rmap_ibi_config, rmap_pp_sg, rmap_dev_char_addr, rmap_dev_char_data
);
endinterface // i3c_controller_rmap_v1_0
`endif
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<spirit:abstractionDefinition xmlns:xilinx="http://www.xilinx.com" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<spirit:vendor>analog.com</spirit:vendor>
<spirit:library>interface</spirit:library>
<spirit:name>i3c_controller_rtl</spirit:name>
<spirit:version>1.0</spirit:version>
<spirit:busType spirit:vendor="analog.com" spirit:library="interface" spirit:name="i3c_controller" spirit:version="1.0"/>
<spirit:ports>
<spirit:port>
<spirit:logicalName>scl</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>sdo</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>sdi</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>t</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
</spirit:ports>
</spirit:abstractionDefinition>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<spirit:busDefinition xmlns:xilinx="http://www.xilinx.com" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<spirit:vendor>analog.com</spirit:vendor>
<spirit:library>interface</spirit:library>
<spirit:name>i3c_controller_sdio</spirit:name>
<spirit:version>1.0</spirit:version>
<spirit:directConnection>false</spirit:directConnection>
<spirit:isAddressable>false</spirit:isAddressable>
<spirit:maxMasters>1</spirit:maxMasters>
<spirit:maxSlaves>1</spirit:maxSlaves>
</spirit:busDefinition>
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<spirit:abstractionDefinition xmlns:xilinx="http://www.xilinx.com" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<spirit:vendor>analog.com</spirit:vendor>
<spirit:library>interface</spirit:library>
<spirit:name>i3c_controller_sdio_rtl</spirit:name>
<spirit:version>1.0</spirit:version>
<spirit:busType spirit:vendor="analog.com" spirit:library="interface" spirit:name="i3c_controller_sdio" spirit:version="1.0"/>
<spirit:ports>
<spirit:port>
<spirit:logicalName>sdo_ready</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>sdo_valid</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>sdo</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>8</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>8</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>sdi_ready</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>sdi_valid</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>sdi_last</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>sdi</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>8</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>8</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>ibi_ready</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>ibi_valid</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>1</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
<spirit:port>
<spirit:logicalName>ibi</spirit:logicalName>
<spirit:wire>
<spirit:onMaster>
<spirit:presence>required</spirit:presence>
<spirit:width>15</spirit:width>
<spirit:direction>in</spirit:direction>
</spirit:onMaster>
<spirit:onSlave>
<spirit:presence>required</spirit:presence>
<spirit:width>15</spirit:width>
</spirit:onSlave>
</spirit:wire>
</spirit:port>
</spirit:ports>
</spirit:abstractionDefinition>
@@ -0,0 +1,81 @@
// (c) Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
// (c) Copyright 2022-2024 Advanced Micro Devices, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of AMD and is protected under U.S. and international copyright
// and other intellectual property laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant any
// rights to the materials distributed herewith. Except as
// otherwise provided in a valid license issued to you by
// AMD, and to the maximum extent permitted by applicable
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
// WITH ALL FAULTS, AND AMD HEREBY DISCLAIMS ALL WARRANTIES
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
// (2) AMD shall not be liable (whether in contract or tort,
// including negligence, or under any other theory of
// liability) for any loss or damage of any kind or nature
// related to, arising under or in connection with these
// materials, including for any direct, or any indirect,
// special, incidental, or consequential loss or damage
// (including loss of data, profits, goodwill, or any type of
// loss or damage suffered as a result of any action brought
// by a third party) even if such damage or loss was
// reasonably foreseeable or AMD had been advised of the
// possibility of the same.
//
// CRITICAL APPLICATIONS
// AMD products are not designed or intended to be fail-
// safe, or for use in any application requiring fail-safe
// performance, such as life-support or safety devices or
// systems, Class III medical devices, nuclear facilities,
// applications related to the deployment of airbags, or any
// other applications that could lead to death, personal
// injury, or severe property or environmental damage
// (individually and collectively, "Critical
// Applications"). Customer assumes the sole risk and
// liability of any use of AMD products in Critical
// Applications, subject only to applicable laws and
// regulations governing limitations on product liability.
//
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
// PART OF THIS FILE AT ALL TIMES.
//
// DO NOT MODIFY THIS FILE.
`ifndef i3c_controller_sdio_v1_0
`define i3c_controller_sdio_v1_0
interface i3c_controller_sdio_v1_0();
logic sdo_ready; //
logic sdo_valid; //
logic [7:0] sdo; //
logic sdi_ready; //
logic sdi_valid; //
logic sdi_last; //
logic [7:0] sdi; //
logic ibi_ready; //
logic ibi_valid; //
logic [14:0] ibi; //
modport MASTER (
input sdo_ready, sdi_valid, sdi_last, sdi, ibi_valid, ibi,
output sdo_valid, sdo, sdi_ready, ibi_ready
);
modport SLAVE (
input sdo_valid, sdo, sdi_ready, ibi_ready,
output sdo_ready, sdi_valid, sdi_last, sdi, ibi_valid, ibi
);
modport MONITOR (
input sdo_ready, sdo_valid, sdo, sdi_ready, sdi_valid, sdi_last, sdi, ibi_ready, ibi_valid, ibi
);
endinterface // i3c_controller_sdio_v1_0
`endif
@@ -0,0 +1,75 @@
// (c) Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
// (c) Copyright 2022-2024 Advanced Micro Devices, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of AMD and is protected under U.S. and international copyright
// and other intellectual property laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant any
// rights to the materials distributed herewith. Except as
// otherwise provided in a valid license issued to you by
// AMD, and to the maximum extent permitted by applicable
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
// WITH ALL FAULTS, AND AMD HEREBY DISCLAIMS ALL WARRANTIES
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
// (2) AMD shall not be liable (whether in contract or tort,
// including negligence, or under any other theory of
// liability) for any loss or damage of any kind or nature
// related to, arising under or in connection with these
// materials, including for any direct, or any indirect,
// special, incidental, or consequential loss or damage
// (including loss of data, profits, goodwill, or any type of
// loss or damage suffered as a result of any action brought
// by a third party) even if such damage or loss was
// reasonably foreseeable or AMD had been advised of the
// possibility of the same.
//
// CRITICAL APPLICATIONS
// AMD products are not designed or intended to be fail-
// safe, or for use in any application requiring fail-safe
// performance, such as life-support or safety devices or
// systems, Class III medical devices, nuclear facilities,
// applications related to the deployment of airbags, or any
// other applications that could lead to death, personal
// injury, or severe property or environmental damage
// (individually and collectively, "Critical
// Applications"). Customer assumes the sole risk and
// liability of any use of AMD products in Critical
// Applications, subject only to applicable laws and
// regulations governing limitations on product liability.
//
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
// PART OF THIS FILE AT ALL TIMES.
//
// DO NOT MODIFY THIS FILE.
`ifndef i3c_controller_v1_0
`define i3c_controller_v1_0
interface i3c_controller_v1_0();
logic scl; //
logic sdo; //
logic sdi; //
logic t; //
modport MASTER (
input sdi,
output scl, sdo, t
);
modport SLAVE (
input scl, sdo, t,
output sdi
);
modport MONITOR (
input scl, sdo, sdi, t
);
endinterface // i3c_controller_v1_0
`endif
@@ -0,0 +1,47 @@
###############################################################################
## Copyright (C) 2023 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################
source ../../../scripts/adi_env.tcl
source $ad_hdl_dir/library/scripts/adi_ip_xilinx.tcl
# Bus interface
adi_if_define "i3c_controller"
adi_if_ports output 1 scl
adi_if_ports output 1 sdo
adi_if_ports input 1 sdi
adi_if_ports output 1 t
# Interface between Host Interface and Core for commands
adi_if_define "i3c_controller_cmdp"
adi_if_ports input 1 cmdp_ready
adi_if_ports output 1 cmdp_valid
adi_if_ports output 31 cmdp
adi_if_ports input 3 cmdp_error
adi_if_ports input 1 cmdp_nop
adi_if_ports input 1 cmdp_daa_trigger
# Interface between Host Interface and Core for register map access
adi_if_define "i3c_controller_rmap"
adi_if_ports output 2 rmap_ibi_config
adi_if_ports output 2 rmap_pp_sg
adi_if_ports input 7 rmap_dev_char_addr
adi_if_ports output 4 rmap_dev_char_data
# Interface between Host Interface and Core for data transfer
adi_if_define "i3c_controller_sdio"
adi_if_ports input 1 sdo_ready
adi_if_ports output 1 sdo_valid
adi_if_ports output 8 sdo
adi_if_ports output 1 sdi_ready
adi_if_ports input 1 sdi_valid
adi_if_ports input 1 sdi_last
adi_if_ports input 8 sdi
adi_if_ports output 1 ibi_ready
adi_if_ports input 1 ibi_valid
adi_if_ports input 15 ibi
@@ -0,0 +1,53 @@
###############################################################################
## Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################
proc i3c_controller_create {{name "i3c_controller"} {async_clk 0} {clk_mod 1} {offload 1} {max_devs 16}} {
create_bd_cell -type hier $name
current_bd_instance /$name
if {$async_clk == 1} {
create_bd_pin -dir I -type clk aclk
}
create_bd_pin -dir I -type clk clk
create_bd_pin -dir I -type rst reset_n
create_bd_pin -dir O irq
create_bd_intf_pin -mode Master -vlnv analog.com:interface:i3c_controller_rtl:1.0 m_i3c
if {$offload == 1} {
create_bd_pin -dir I trigger
create_bd_intf_pin -mode Master -vlnv xilinx.com:interface:axis_rtl:1.0 offload_sdi
}
ad_ip_instance i3c_controller_host_interface host_interface
ad_ip_parameter host_interface CONFIG.ASYNC_CLK $async_clk
ad_ip_parameter host_interface CONFIG.OFFLOAD $offload
ad_ip_instance i3c_controller_core core
ad_ip_parameter core CONFIG.MAX_DEVS $max_devs
ad_ip_parameter core CONFIG.CLK_MOD $clk_mod
ad_connect clk host_interface/s_axi_aclk
if {$async_clk == 1} {
ad_connect aclk host_interface/clk
ad_connect aclk core/clk
} else {
ad_connect clk core/clk
}
if {$offload == 1} {
ad_connect trigger host_interface/offload_trigger
ad_connect host_interface/offload_sdi offload_sdi
}
ad_connect core/i3c m_i3c
ad_connect host_interface/reset_n core/reset_n
ad_connect host_interface/rmap core/rmap
ad_connect host_interface/cmdp core/cmdp
ad_connect host_interface/sdio core/sdio
ad_connect reset_n host_interface/s_axi_aresetn
ad_connect irq host_interface/irq
current_bd_instance /
}
@@ -0,0 +1,24 @@
###############################################################################
## Copyright (C) 2024 Analog Devices, Inc. All rights reserved.
### SPDX short identifier: ADIBSD
###############################################################################
proc i3c_controller_create {{name "i3c_controller"} {async_clk 0} {clk_mod 1} {offload 1} {max_devs 16}} {
add_instance ${name}_host_interface i3c_controller_host_interface
set_instance_parameter_value ${name}_host_interface {ASYNC_CLK} $async_clk
set_instance_parameter_value ${name}_host_interface {OFFLOAD} $offload
add_instance ${name}_core i3c_controller_core
set_instance_parameter_value ${name}_core {MAX_DEVS} $max_devs
set_instance_parameter_value ${name}_core {CLK_MOD} $clk_mod
add_connection ${name}_host_interface.sdo ${name}_core.sdo
add_connection ${name}_host_interface.cmdp ${name}_core.cmdp
add_connection ${name}_host_interface.rmap ${name}_core.rmap
add_connection ${name}_core.sdi ${name}_host_interface.sdi
add_connection ${name}_core.ibi ${name}_host_interface.ibi
add_connection ${name}_host_interface.if_reset_n ${name}_core.if_reset_n
}