Skip to content
Snippets Groups Projects
Commit 234233bf authored by dwf1m12's avatar dwf1m12
Browse files

modify debug tests and testbench harness for 8-bit GPIO0 chips (44-pin for example)

parent 43092cb3
No related branches found
No related tags found
No related merge requests found
...@@ -39,29 +39,19 @@ ...@@ -39,29 +39,19 @@
// //
// CM0_MCU GPIO0 -------------------------------------- Debug Tester // CM0_MCU GPIO0 -------------------------------------- Debug Tester
// //
// GPIO[15] 7 <----------------------------------------< Running // GPIO[7] 7 <----------------------------------------< Running
// GPIO[14] 6 <----------------------------------------< Error // GPIO[6] 6 <----------------------------------------< Error
// GPIO[13] 5 >----------------------------------------> Function Strobe // GPIO[5] 5 >----------------------------------------> Function Strobe
// GPIO[12] 4 >----------------------------------------> Function Select bit 4 // GPIO[4] 4 >----------------------------------------> Function Select bit 4
// GPIO[11] 3 >----------------------------------------> Function Select bit 3 // GPIO[3] 3 >----------------------------------------> Function Select bit 3
// GPIO[10] 2 >----------------------------------------> Function Select bit 2 // GPIO[2] 2 >----------------------------------------> Function Select bit 2
// GPIO[9] 1 >----------------------------------------> Function Select bit 1 // GPIO[1] 1 >----------------------------------------> Function Select bit 1
// GPIO[8] 0 >----------------------------------------> Function Select bit 0 // GPIO[0] 0 >----------------------------------------> Function Select bit 0
// #define DEBUG_BIT_LOC 0 //GPIO[0] is the ls bit of Function Select
#define DEBUG_BIT_LOC 8 //GPIO[8] is the least bit of Function Select #define DEBUG_CMD 0x3f //GPIO [5:0]
#define DEBUG_CMD 0x3f<<8 //GPIO [13:8] #define DEBUG_STROBE 0x20 //GPIO [5]
#define DEBUG_STROBE 0x00002000 //GPIO [13] #define DEBUG_ERROR 0x40 //GPIO [6]
#define DEBUG_ERROR 0x00004000 //GPIO [14] #define DEBUG_RUNNING 0x80 //GPIO [7]
#define DEBUG_RUNNING 0x00008000 //GPIO [15]
// GPIO1[7] 7
// GPIO1[6] 6
// GPIO1[5] 5
// GPIO1[4] 4
// GPIO1[3] 3
// GPIO1[2] 2
// GPIO1[1] 1
// GPIO1[0] 0
// CM0 MCU's view of the memory shared with the debugtester // CM0 MCU's view of the memory shared with the debugtester
......
...@@ -69,30 +69,19 @@ extern uint32_t CheckDebugTester(void); ...@@ -69,30 +69,19 @@ extern uint32_t CheckDebugTester(void);
// //
// CM0_MCU GPIO0 -------------------------------------- Debug Tester // CM0_MCU GPIO0 -------------------------------------- Debug Tester
// //
// GPIO[15] 7 <----------------------------------------< Running // GPIO[7] 7 <----------------------------------------< Running
// GPIO[14] 6 <----------------------------------------< Error // GPIO[6] 6 <----------------------------------------< Error
// GPIO[13] 5 >----------------------------------------> Function Strobe // GPIO[5] 5 >----------------------------------------> Function Strobe
// GPIO[12] 4 >----------------------------------------> Function Select bit 4 // GPIO[4] 4 >----------------------------------------> Function Select bit 4
// GPIO[11] 3 >----------------------------------------> Function Select bit 3 // GPIO[3] 3 >----------------------------------------> Function Select bit 3
// GPIO[10] 2 >----------------------------------------> Function Select bit 2 // GPIO[2] 2 >----------------------------------------> Function Select bit 2
// GPIO[9] 1 >----------------------------------------> Function Select bit 1 // GPIO[1] 1 >----------------------------------------> Function Select bit 1
// GPIO[8] 0 >----------------------------------------> Function Select bit 0 // GPIO[0] 0 >----------------------------------------> Function Select bit 0
// #define DEBUG_BIT_LOC 0 //GPIO[0] is the ls bit of Function Select
#define DEBUG_BIT_LOC 8 //GPIO[8] is the least bit of Function Select #define DEBUG_CMD 0x3f //GPIO [5:0]
#define DEBUG_CMD 0x3f<<8 //GPIO [13:8] #define DEBUG_STROBE 0x20 //GPIO [5]
#define DEBUG_STROBE 0x00002000 //GPIO [13] #define DEBUG_ERROR 0x40 //GPIO [6]
#define DEBUG_ERROR 0x00004000 //GPIO [14] #define DEBUG_RUNNING 0x80 //GPIO [7]
#define DEBUG_RUNNING 0x00008000 //GPIO [15]
// GPIO1[7] 7
// GPIO1[6] 6
// GPIO1[5] 5
// GPIO1[4] 4
// GPIO1[3] 3
// GPIO1[2] 2
// GPIO1[1] 1
// GPIO1[0] 0
// CMSDK example MCU's view of the memory shared with the debugtester // CMSDK example MCU's view of the memory shared with the debugtester
// (4 words above stack top) // (4 words above stack top)
......
...@@ -103,11 +103,29 @@ SROM_Ax32 ...@@ -103,11 +103,29 @@ SROM_Ax32
.SEL(1'b0), .SEL(1'b0),
.RDATA( ) .RDATA( )
); );
`ifdef SDF_SIM
initial
$sdf_annotate ( "../../../src/rtl/nanosoc_chip_pads_44pin.sdf"
, u_nanosoc_chip_pads
,
, "sdf_annotate.log"
, "MAXIMUM"
);
`endif // SDF_SIM
`ifdef VCD_SIM
initial begin
$dumpfile("waves.vcd");
$dumpvars(6,u_nanosoc_chip_pads);
end
`endif // VCD_SIM
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
// Cortex-M0/Cortex-M0+ Microcontroller // Cortex-M0/Cortex-M0+ Microcontroller
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
`ifdef SDF_SIM
nanosoc_chip_pads nanosoc_chip_pads
u_nanosoc_chip_pads ( u_nanosoc_chip_pads (
`ifdef POWER_PINS `ifdef POWER_PINS
...@@ -120,12 +138,30 @@ SROM_Ax32 ...@@ -120,12 +138,30 @@ SROM_Ax32
.CLK (CLK), // input .CLK (CLK), // input
.TEST (TEST), // input .TEST (TEST), // input
.NRST (NRST), // active low reset .NRST (NRST), // active low reset
.P0 (P0), .P0 (P0[7:0]),
.P1 (P1), .P1 (P1[7:0]),
.SWDIO (SWDIOTMS), .SWDIO (SWDIOTMS),
.SWDCK (SWCLKTCK) .SWDCK (SWCLKTCK)
); );
`else
nanosoc_chip_pads
u_nanosoc_chip_pads (
`ifdef POWER_PINS
.VDDIO (VDDIO),
.VSSIO (VSSIO),
.VDD (VDD),
.VSS (VSS),
.VDDACC (VDDACC),
`endif
.CLK (CLK), // input
.TEST (TEST), // input
.NRST (NRST), // active low reset
.P0 (P0[15:0]),
.P1 (P1[15:0]),
.SWDIO (SWDIOTMS),
.SWDCK (SWCLKTCK)
);
`endif
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
// Source for clock and reset // Source for clock and reset
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
...@@ -658,22 +694,21 @@ nanosoc_ft1248x1_track ...@@ -658,22 +694,21 @@ nanosoc_ft1248x1_track
pulldown(debug_err); pulldown(debug_err);
//Tristate logic for GPIO connection //Tristate logic for GPIO connection
bufif1 (debug_command[5], P0[29-16], debug_test_en); bufif1 (P0[7], debug_running, debug_test_en);
bufif1 (debug_command[4], P0[28-16], debug_test_en); bufif1 (P0[6], debug_err, debug_test_en);
bufif1 (debug_command[3], P0[27-16], debug_test_en); bufif1 (debug_command[5], P0[3], debug_test_en);
bufif1 (debug_command[2], P0[26-16], debug_test_en); bufif1 (debug_command[4], P0[4], debug_test_en);
bufif1 (debug_command[1], P0[25-16], debug_test_en); bufif1 (debug_command[3], P0[3], debug_test_en);
bufif1 (debug_command[0], P0[24-16], debug_test_en); bufif1 (debug_command[2], P0[2], debug_test_en);
bufif1 (debug_command[1], P0[1], debug_test_en);
bufif1 (P0[31-16], debug_running, debug_test_en); bufif1 (debug_command[0], P0[0], debug_test_en);
bufif1 (P0[30-16], debug_err, debug_test_en);
cmsdk_debug_tester #(.ROM_MEMFILE((BE==1) ? "debugtester_be.hex" : "debugtester_le.hex")) cmsdk_debug_tester #(.ROM_MEMFILE((BE==1) ? "debugtester_be.hex" : "debugtester_le.hex"))
u_cmsdk_debug_tester u_cmsdk_debug_tester
( (
// Clock and Reset // Clock and Reset
.CLK (CLK), .CLK (CLK),
.PORESETn (NRST), .PORESETn (NRST_ext),
// Command Interface // Command Interface
.DBGCMD (debug_command[5:0]), .DBGCMD (debug_command[5:0]),
......
...@@ -114,12 +114,12 @@ localparam BUFSIZE = (64 * 1024); ...@@ -114,12 +114,12 @@ localparam BUFSIZE = (64 * 1024);
$write("** %m : input file length measured as: %d **\n", flen); $write("** %m : input file length measured as: %d **\n", flen);
if (flen > 0) flen=flen-1; // correct for extra char count(???) if (flen > 0) flen=flen-1; // correct for extra char count(???)
// now output the entire adp buffer to the stream // now output the entire adp buffer to the stream
flen = flen + clen+25+1; flen = flen + clen+25;
fp = 0; fp = 0;
valid <= 0; valid <= 0;
begin begin
@(posedge aresetn); @(posedge aresetn);
while (fp < flen) begin while (fp <= flen) begin
@(posedge aclk); @(posedge aclk);
data8 <= adpbuf[fp]; data8 <= adpbuf[fp];
fp = fp + 1; fp = fp + 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment