Skip to content

Commit

Permalink
tests: Added loopback test bitstreams for all supported devices
Browse files Browse the repository at this point in the history
azonenberg committed Oct 24, 2016
1 parent 996af82 commit e849edc
Showing 3 changed files with 107 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/greenpak4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -85,7 +85,12 @@ add_greenpak4_test(Vector SLG46620V)
# Compile bitstreams for HiL tests

add_greenpak4_bitstream(PGA SLG46620V)

# These bitstreams are hard coded in gpdevboard/SocketTest
# but we ship source for standalone HiL test support and verification
add_greenpak4_bitstream(SocketTestLoopback_STQFN14 SLG46140V)
add_greenpak4_bitstream(SocketTestLoopback_STQFN20 SLG46620V)
add_greenpak4_bitstream(SocketTestLoopback_STQFN20D SLG46621V)

########################################################################################################################
# Compile binaries for HiL tests (no install required here)
51 changes: 51 additions & 0 deletions tests/greenpak4/SocketTestLoopback_STQFN20.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/***********************************************************************************************************************
* Copyright (C) 2016 Andrew Zonenberg and contributors *
* *
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General *
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) *
* any later version. *
* *
* This program 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. See the GNU Lesser General Public License for *
* more details. *
* *
* You should have received a copy of the GNU Lesser General Public License along with this program; if not, you may *
* find one here: *
* https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt *
* or you may search the http://www.gnu.org website for the version 2.1 license, or you may write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
**********************************************************************************************************************/

`default_nettype none

/**
INPUTS:
Test input on pin 2
OUTPUTS:
The same signal echoed to all other GPIOs
TEST PROCEDURE:
Send arbitrary digital waveform into pin 2
Expect the same waveform echoed from all other pins
Note that this will detect open circuit or stuck-at faults in the socket, but not shorts between pins.
*/
module SocketTestLoopback_STQFN20(din, dout);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// I/O declarations

(* LOC = "P2" *)
input wire din;

(* LOC = "P20 P19 P18 P17 P16 P15 P14 P13 P12 P10 P9 P8 P7 P6 P5 P4 P3" *)
output wire[16:0] dout;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The actual logic

//... if you can even call it that!
assign dout = {17{din}};

endmodule
51 changes: 51 additions & 0 deletions tests/greenpak4/SocketTestLoopback_STQFN20D.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/***********************************************************************************************************************
* Copyright (C) 2016 Andrew Zonenberg and contributors *
* *
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General *
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) *
* any later version. *
* *
* This program 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. See the GNU Lesser General Public License for *
* more details. *
* *
* You should have received a copy of the GNU Lesser General Public License along with this program; if not, you may *
* find one here: *
* https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt *
* or you may search the http://www.gnu.org website for the version 2.1 license, or you may write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
**********************************************************************************************************************/

`default_nettype none

/**
INPUTS:
Test input on pin 2
OUTPUTS:
The same signal echoed to all other GPIOs
TEST PROCEDURE:
Send arbitrary digital waveform into pin 2
Expect the same waveform echoed from all other pins
Note that this will detect open circuit or stuck-at faults in the socket, but not shorts between pins.
*/
module SocketTestLoopback_STQFN20D(din, dout);

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// I/O declarations

(* LOC = "P2" *)
input wire din;

(* LOC = "P20 P19 P18 P17 P16 P15 P13 P12 P10 P9 P8 P7 P6 P5 P4 P3" *)
output wire[15:0] dout;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The actual logic

//... if you can even call it that!
assign dout = {16{din}};

endmodule

0 comments on commit e849edc

Please sign in to comment.