Skip to content
Snippets Groups Projects
Commit be20bc53 authored by dam1n19's avatar dam1n19
Browse files

Restructured Interconnect

parent cb770ea8
Branches
Tags
1 merge request!1changed imem to rom to allow initial program loading, updated bootloader code...
...@@ -90,7 +90,7 @@ module nanosoc_chip #( ...@@ -90,7 +90,7 @@ module nanosoc_chip #(
wire CLK; wire CLK;
assign xtal_clk_o = xtal_clk_out; assign xtal_clk_o = xtal_clk_out;
wire nrst_in = nrst_i; wire SYSRESETn = nrst_i;
wire [15:0] p0_in; // level-shifted input from pad wire [15:0] p0_in; // level-shifted input from pad
wire [15:0] p0_out; // output port drive wire [15:0] p0_out; // output port drive
wire [15:0] p0_out_en; // active high output drive enable (pad tech dependent) wire [15:0] p0_out_en; // active high output drive enable (pad tech dependent)
...@@ -262,7 +262,7 @@ module nanosoc_chip #( ...@@ -262,7 +262,7 @@ module nanosoc_chip #(
u_nanosoc_mcu_clkctrl( u_nanosoc_mcu_clkctrl(
// inputs // inputs
.XTAL1 (CLK), .XTAL1 (CLK),
.NRST (nrst_in), .NRST (SYSRESETn),
.APBACTIVE (APBACTIVE), .APBACTIVE (APBACTIVE),
.SLEEPING (SLEEPING), .SLEEPING (SLEEPING),
...@@ -289,16 +289,16 @@ module nanosoc_chip #( ...@@ -289,16 +289,16 @@ module nanosoc_chip #(
.PRESETn (PRESETn) .PRESETn (PRESETn)
); );
wire gated_hclk; wire HCLKG;
wire gated_dclk; wire DCLKG;
wire gated_sclk; wire SCLKG;
cortexm0_rst_ctl u_rst_ctl cortexm0_rst_ctl u_rst_ctl
(// Inputs (// Inputs
.GLOBALRESETn (nrst_in), .GLOBALRESETn (SYSRESETn),
.FCLK (FCLK), .FCLK (FCLK),
.HCLK (gated_hclk), .HCLK (HCLKG),
.DCLK (gated_dclk), .DCLK (DCLKG),
.SYSRESETREQ (NANOSOC_SYSRESETREQ), .SYSRESETREQ (NANOSOC_SYSRESETREQ),
.PMUHRESETREQ (PMUHRESETREQ), .PMUHRESETREQ (PMUHRESETREQ),
.PMUDBGRESETREQ (PMUDBGRESETREQ), .PMUDBGRESETREQ (PMUDBGRESETREQ),
...@@ -332,9 +332,9 @@ module nanosoc_chip #( ...@@ -332,9 +332,9 @@ module nanosoc_chip #(
.CGBYPASS (TESTMODE), .CGBYPASS (TESTMODE),
// Outputs // Outputs
.HCLK (gated_hclk), .HCLK (HCLKG),
.DCLK (gated_dclk), .DCLK (DCLKG),
.SCLK (gated_sclk), .SCLK (SCLKG),
.WICENREQ (WICENREQ), .WICENREQ (WICENREQ),
.CDBGPWRUPACK (CDBGPWRUPACK), .CDBGPWRUPACK (CDBGPWRUPACK),
.SYSISOLATEn (SYSISOLATEn), .SYSISOLATEn (SYSISOLATEn),
...@@ -348,9 +348,9 @@ module nanosoc_chip #( ...@@ -348,9 +348,9 @@ module nanosoc_chip #(
); );
// Bypass clock gating cell in PMU if CLKGATE_PRESENT is 0 // Bypass clock gating cell in PMU if CLKGATE_PRESENT is 0
assign HCLK = (CLKGATE_PRESENT==0) ? FCLK : gated_hclk; assign HCLK = (CLKGATE_PRESENT==0) ? FCLK : HCLKG;
assign DCLK = (CLKGATE_PRESENT==0) ? FCLK : gated_dclk; assign DCLK = (CLKGATE_PRESENT==0) ? FCLK : DCLKG;
assign SCLK = (CLKGATE_PRESENT==0) ? FCLK : gated_sclk; assign SCLK = (CLKGATE_PRESENT==0) ? FCLK : SCLKG;
// In this example system, power control takes place immediately. // In this example system, power control takes place immediately.
...@@ -1370,7 +1370,7 @@ localparam AWRAM8 = ADDR_WIDTH_RAM; // Address width - to match RAM instance siz ...@@ -1370,7 +1370,7 @@ localparam AWRAM8 = ADDR_WIDTH_RAM; // Address width - to match RAM instance siz
// Cortex-M0 integration level // Cortex-M0 integration level
nanosoc_cpu u_nanosoc_cpu ( nanosoc_cpu u_nanosoc_cpu (
.HCLK (gated_hclk), //HCLK), .HCLK (HCLKG), //HCLK),
.FCLK (FCLK), .FCLK (FCLK),
.DCLK (DCLK), .DCLK (DCLK),
.SCLK (SCLK), .SCLK (SCLK),
......
...@@ -21,13 +21,16 @@ module nanosoc_interconnect #( ...@@ -21,13 +21,16 @@ module nanosoc_interconnect #(
// System Manager Parameters // System Manager Parameters
parameter DMA_CHANNEL_NUM = 2 parameter DMA_CHANNEL_NUM = 2
)( )(
// Global Clocks and Reset // System Clocks and Resets
input wire GLOBALRESETn, // Global Reset input wire FCLK, // Free-running Clock
input wire SYSRESETn, // System Reset
// Clocks, Gated-Clocks and Reset - AHB-lite input wire PORESETn, // Power On Reset
input wire HCLK, // Clock
input wire HCLKG, // Gated Clock // Clocks, Gated-Clocks and Reset - Generated from CPU
input wire HRESETn, // Reset output wire HCLK, // Clock
output wire SCLK, // System Clock
output wire HCLKG, // Gated Clock
output wire HRESETn, // Reset
// Clocks, Gated-Clocks and Resets - APB // Clocks, Gated-Clocks and Resets - APB
input wire PCLK, // Clock input wire PCLK, // Clock
...@@ -39,11 +42,6 @@ module nanosoc_interconnect #( ...@@ -39,11 +42,6 @@ module nanosoc_interconnect #(
input wire DCLKG, // Gated Clock input wire DCLKG, // Gated Clock
input wire DBGRESETn, // Reset input wire DBGRESETn, // Reset
// System Clocks and Resets
input wire FCLK, // Free-running Clock
input wire SCLK, // System Clock
input wire PORESETn, // Power On Reset
// Serial Wire Debug Interface // Serial Wire Debug Interface
input wire SWCLK, // SWD data input input wire SWCLK, // SWD data input
input wire SWDI, // SWD clock input wire SWDI, // SWD clock
...@@ -198,8 +196,8 @@ module nanosoc_interconnect #( ...@@ -198,8 +196,8 @@ module nanosoc_interconnect #(
// Instantiate NanoSoC Bus Matrix // Instantiate NanoSoC Bus Matrix
nanosoc_busmatrix_lite u_busmatrix ( nanosoc_busmatrix_lite u_busmatrix (
// AHB Clock and Reset Signals // AHB Clock and Reset Signals
.HCLK (HCLK), .HCLK (FCLK),
.HRESETn (HRESETn), .HRESETn (SYSRESETn),
// System Address Remap Control // System Address Remap Control
.REMAP ({3'b0, !ROM_REMAP}), .REMAP ({3'b0, !ROM_REMAP}),
......
...@@ -61,7 +61,7 @@ module nanosoc_manager_cortexm0 #( ...@@ -61,7 +61,7 @@ module nanosoc_manager_cortexm0 #(
output wire CCTRLRESETREQ, // CPU Control Reset Request (PMU and Reset Unit) output wire CCTRLRESETREQ, // CPU Control Reset Request (PMU and Reset Unit)
// Generated Clocks and Resets // Generated Clocks and Resets
output wire HCLK, // (HCLK master) output wire HCLK, // AHB Clock
output wire SCLK, // System clock output wire SCLK, // System clock
output wire HRESETn, // AHB and System reset output wire HRESETn, // AHB and System reset
output wire PORESETn, // Power on reset output wire PORESETn, // Power on reset
...@@ -106,14 +106,14 @@ module nanosoc_manager_cortexm0 #( ...@@ -106,14 +106,14 @@ module nanosoc_manager_cortexm0 #(
// Cortex-M0 Power Management and Reset Control Unit // Cortex-M0 Power Management and Reset Control Unit
// --------------------------------------------------- // ---------------------------------------------------
// Cortex-M0 Control to Core Connectivity // Cortex-M0 Control to Core Connectivity
wire GATEHCLK; // Control Signal from CPU to Control CLock Gating of HCLK wire GATEHCLK; // Control Signal from CPU to Control CLock Gating of HCLK
wire WAKEUP; // Wake-up Signaling from Core wire WAKEUP; // Wake-up Signaling from Core
wire CDBGPWRUPREQ; // Core Debug Power Up Request wire CDBGPWRUPREQ; // Core Debug Power Up Request
wire CDBGPWRUPACK; // Core Debug Power Up Acknowledge wire CDBGPWRUPACK; // Core Debug Power Up Acknowledge
wire WICENREQ; // WIC enable request from PMU wire WICENREQ; // WIC enable request from PMU
wire WICENACK; // Wake-on-Interrupt Enable ACK from Core wire WICENACK; // Wake-on-Interrupt Enable ACK from Core
wire SLEEPHOLDREQn; // Core Sleep Hold Request wire SLEEPHOLDREQn; // Core Sleep Hold Request
wire SLEEPHOLDACKn; // Core Sleep Hold Acknowledgement wire SLEEPHOLDACKn; // Core Sleep Hold Acknowledgement
// Cortex-M0 Control Instantiation // Cortex-M0 Control Instantiation
nanosoc_cortexm0_control #( nanosoc_cortexm0_control #(
...@@ -167,7 +167,7 @@ module nanosoc_manager_cortexm0 #( ...@@ -167,7 +167,7 @@ module nanosoc_manager_cortexm0 #(
.DIV_RATIO (18'd01000) .DIV_RATIO (18'd01000)
) u_stclkctrl ( ) u_stclkctrl (
.FCLK (FCLK), .FCLK (FCLK),
.SYSRESETn (HRESETn), .SYSRESETn (SYSRESETn),
.STCLKEN (STCLKEN), .STCLKEN (STCLKEN),
.STCALIB (STCALIB) .STCALIB (STCALIB)
...@@ -247,17 +247,16 @@ module nanosoc_manager_cortexm0 #( ...@@ -247,17 +247,16 @@ module nanosoc_manager_cortexm0 #(
.IRQLATENCY (8'h00), .IRQLATENCY (8'h00),
.ECOREVNUM (28'h0), .ECOREVNUM (28'h0),
// Systick // Systick
.STCLKEN (STCLKEN), .STCLKEN (STCLKEN),
.STCALIB (STCALIB), .STCALIB (STCALIB),
// Debug - JTAG or Serial wire // Debug - JTAG or Serial wire
// inputs
.nTRST (1'b1), .nTRST (1'b1),
.SWDITMS (SWDI), .SWDITMS (SWDI),
.SWCLKTCK (SWCLK), .SWCLKTCK (SWCLK),
.TDI (1'b0), .TDI (1'b0),
// outputs
.TDO ( ), .TDO ( ),
.nTDOEN ( ), .nTDOEN ( ),
.SWDO (SWDO), .SWDO (SWDO),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment