-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZBasic, updated for the GPIO toggle test
- Loading branch information
Showing
113 changed files
with
3,300 additions
and
1,392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
################################################################################ | ||
## | ||
## Filename: gpio.txt | ||
## | ||
## Project: AutoFPGA, a utility for composing FPGA designs from peripherals | ||
## | ||
## Purpose: | ||
## | ||
## Creator: Dan Gisselquist, Ph.D. | ||
## Gisselquist Technology, LLC | ||
## | ||
################################################################################ | ||
## | ||
## Copyright (C) 2017-2019, Gisselquist Technology, LLC | ||
## | ||
## This program is free software (firmware): you can redistribute it and/or | ||
## modify it under the terms of the GNU General Public License as published | ||
## by the Free Software Foundation, either version 3 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 MERCHANTIBILITY or | ||
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
## for more details. | ||
## | ||
## You should have received a copy of the GNU General Public License along | ||
## with this program. (It's in the $(ROOT)/doc directory. Run make with no | ||
## target there if the PDF file isn't present.) If not, see | ||
## <http://www.gnu.org/licenses/> for a copy. | ||
## | ||
## License: GPL, v3, as defined and found on www.gnu.org, | ||
## http://www.gnu.org/licenses/gpl.html | ||
## | ||
## | ||
################################################################################ | ||
## | ||
## | ||
@PREFIX=gpio | ||
@DEVID=GPIO | ||
@NADDR=1 | ||
@ACCESS=@$(DEVID)_ACCESS | ||
@SLAVE.TYPE=SINGLE | ||
@SLAVE.BUS=wb | ||
@NUMOUTPUT=11 | ||
@NUMINPUT=11 | ||
@INT.GPIO.WIRE=gpio_int | ||
@INT.GPIO.PIC=buspic | ||
@TOP.PORTLIST= | ||
// GPIO ports | ||
i_@$(PREFIX), o_@$(PREFIX) | ||
@TOP.IODECL= | ||
// GPIO wires | ||
localparam NGPI = @$(NUMINPUT), NGPO=@$(NUMOUTPUT); | ||
// GPIO ports | ||
input wire [(@$(NUMINPUT)-1):0] i_@$(PREFIX); | ||
output wire [(@$(NUMOUTPUT)-1):0] o_@$(PREFIX); | ||
@TOP.MAIN= | ||
// GPIO wires | ||
i_@$(PREFIX), o_@$(PREFIX) | ||
@MAIN.PORTLIST= | ||
// GPIO ports | ||
i_@$(PREFIX), o_@$(PREFIX) | ||
@MAIN.IODECL= | ||
localparam NGPI = @$(NUMINPUT), NGPO=@$(NUMOUTPUT); | ||
// @$(DEVID) ports | ||
input [(NGPI-1):0] i_@$(PREFIX); | ||
output wire [(NGPO-1):0] o_@$(PREFIX); | ||
@MAIN.INSERT= | ||
// | ||
// @$(DEVID) | ||
// | ||
// This interface should allow us to control up to 16 @$(DEVID) inputs, and | ||
// another 16 @$(DEVID) outputs. The interrupt trips when any of the inputs | ||
// changes. (Sorry, which input isn't (yet) selectable.) | ||
// | ||
localparam INITIAL_@$(DEVID) = @$(NUMOUTPUT)'h0; | ||
wbgpio #(NGPI, NGPO, INITIAL_@$(DEVID)) | ||
@$(PREFIX)i(i_clk, 1'b1, (wb_stb)&&(@$(PREFIX)_sel), wb_we, | ||
wb_data, @$(PREFIX)_data, i_@$(PREFIX), o_@$(PREFIX), | ||
@$(PREFIX)_int); | ||
@REGS.N=1 | ||
@REGS.0= 0 R_@$(DEVID) @$(DEVID) GPI GPO | ||
@BDEF.DEFN= | ||
// | ||
// @$(DEVID) input wires | ||
// | ||
#define @$(DEVID)_IN(WIRE) (((WIRE)>>16)&1) | ||
// | ||
// @$(DEVID) output wires | ||
// | ||
#define @$(DEVID)_SET(WIRE) (((WIRE)<<16)|(WIRE)) | ||
#define @$(DEVID)_CLR(WIRE) ((WIRE)<<16) | ||
// | ||
// | ||
@BDEF.IONAME= i_@$(PREFIX) | ||
@BDEF.IOTYPE= unsigned | ||
@BDEF.OSDEF= _BOARD_HAS_@$(DEVID) | ||
@BDEF.OSVAL= static volatile @$.BDEF.IOTYPE *const _@$(PREFIX) = ((@$.BDEF.IOTYPE *)@$REGBASE); | ||
@RTL.MAKE.FILES=wbgpio.v | ||
@RTL.MAKE.GROUP=@$(DEVID) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.