Compare commits

...

7 Commits

Author SHA1 Message Date
lightside-instruments 911c851e9e
Merge 15a5d8ec8b into f31c39cc2e 2025-06-15 01:52:32 -07:00
Miodrag Milanović f31c39cc2e
Merge pull request #342 from tarikgraba/master
Settings to build pdf documentation
2025-06-03 14:40:39 +02:00
TG 213d116050 Use Lualatex instead of plain pdfatex 2025-06-03 14:30:45 +02:00
TG 8893d13655 Use rsvgconverter sphinx extension to convert svg to pdf 2025-06-03 14:30:45 +02:00
Miodrag Milanović 0bd9f5d7fa
Merge pull request #348 from mattvenn/master
Update Claire's name and fix the reference image in the iceprog help
2025-06-03 11:12:06 +02:00
Matt Venn d06a967590 Update Claire's name and fix the reference image in the iceprog help 2025-06-03 11:06:08 +02:00
Vladimir Vassilev 15a5d8ec8b Added example for ice4pi board 2023-04-10 01:38:44 +02:00
27 changed files with 143 additions and 24 deletions

View File

@ -55,9 +55,8 @@ further defined and clarified by project maintainers.
Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at clifford@clifford.at (and/or
cliffordvienna@gmail.com if you think your mail to the other address got
stuck in the spam filter). All complaints will be reviewed and investigated and
reported by contacting the project team at office@yosyshq.com.
All complaints will be reviewed and investigated and
will result in a response that is deemed necessary and appropriate to the
circumstances. The project team is obligated to maintain confidentiality with
regard to the reporter of an incident. Further details of specific enforcement

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -13,7 +13,9 @@ author = 'YosysHQ'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = ['sphinx_rtd_theme']
extensions = ['sphinx_rtd_theme',
'sphinxcontrib.rsvgconverter'
]
templates_path = ['_templates']
exclude_patterns = []
@ -31,3 +33,5 @@ html_theme_options = {
"titles_only": False
}
html_static_path = ['_static']
latex_engine = 'lualatex'

View File

@ -1,2 +1,3 @@
sphinx
sphinx_rtd_theme
sphinxcontrib-svg2pdfconverter

7
examples/ice4pi/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
*
!.gitignore
!example.v
!ice4pi.pcf
!Makefile
!README
!ice4pi_prog

11
examples/ice4pi/Makefile Normal file
View File

@ -0,0 +1,11 @@
example.bin: example.v ice4pi.pcf
yosys example.ys
arachne-pnr -p ice4pi.pcf example.blif -o example.txt
icebox_explain example.txt > example.ex
icepack example.txt example.bin
load: example.bin
./ice4pi_prog example.bin
clean:
rm -f example.blif example.txt example.ex example.bin

26
examples/ice4pi/README Normal file
View File

@ -0,0 +1,26 @@
Assuming you are running on a Raspberry Pi 2-4 or Zero (tested with bullseye):
1. Install all necessary packages to synthesize rot.v and build bit image (rot.bin) for the ice4pi:
sudo apt-get install yosys fpga-icestorm arachne-pnr flashrom
sudo apt-get install spi-tools
make
2. Make sure your Pi has SPI enabled (e.g. use raspi-config)
3. Load the example.bin file to the shield:
sudo make load
---
4. Validate spi loopback:
echo -n 0123456789ABCDEF | spi-pipe -d /dev/spidev0.1 -s 10000000
You should get back
F0123456789ABCDE
(F may be NUL if this is your first call)

33
examples/ice4pi/example.v Normal file
View File

@ -0,0 +1,33 @@
module top(input clk,
output [4:0] led,
input [7:0] pmod,
//spi interface
output spi_miso,
input spi_mosi,
input spi_clk,
input spi_cs_n);
//parameter SPI_MODE = 1; // CPOL = 0, CPHA = 1
reg [8:0] fifo = 8'd0;
reg [2:0] counter = 0;
always @ (negedge spi_clk)
begin
fifo <= {fifo[7:0],spi_mosi}; // loopback fifo
if(counter < 4'd7) begin
counter <= counter + 1;
end
else begin
counter <= 0;
led <={fifo[3:0],spi_mosi};
end
end
always @ (posedge spi_clk)
begin
spi_miso<=fifo[7]; // loopback
//spi_miso<=pmod[counter]; //logic analyzer
end
endmodule // top

View File

@ -0,0 +1,27 @@
#12 MHz oscillator
set_io clk 21
#Raspberry Pi 40 pin connector
set_io spi_miso 68 # 115
set_io spi_mosi 67 # 114
set_io spi_clk 70 # 112
set_io spi_cs_n 113 # 128 # /ce1
#LEDs
set_io led[0] 99
set_io led[1] 98
set_io led[2] 97
set_io led[3] 96
set_io led[4] 95
#PMOD
set_io pmod[0] 78
set_io pmod[1] 79
set_io pmod[2] 80
set_io pmod[3] 81
set_io pmod[4] 87
set_io pmod[5] 88
set_io pmod[6] 90
set_io pmod[7] 91

11
examples/ice4pi/ice4pi_prog Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
echo 24 > /sys/class/gpio/export || true
echo out > /sys/class/gpio/gpio24/direction
echo 1 >/sys/class/gpio/gpio24/value
sleep 1
echo 0 >/sys/class/gpio/gpio24/value
tr '\0' '\377' < /dev/zero | dd bs=1M count=4 of=image iflag=fullblock
dd if=${1} conv=notrunc of=image
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image
echo 1 >/sys/class/gpio/gpio24/value

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
# Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
# Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
# Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
# Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
# Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
# Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
# Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
# Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
# Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above

View File

@ -1,5 +1,5 @@
//
// Copyright (C) 2016 Clifford Wolf <clifford@clifford.at>
// Copyright (C) 2016 Claire Xenia Wolf <claire@clairexen.net>
// Copyright (C) 2023 Sylvain Munaut <tnt@246tNt.com>
//
// Permission to use, copy, modify, and/or distribute this software for any

View File

@ -1,5 +1,5 @@
//
// Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
// Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
//
// Based on a reference implementation provided by Mathias Lasser
//

View File

@ -1,5 +1,5 @@
//
// Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
// Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above

View File

@ -1,7 +1,7 @@
/*
* iceprog -- simple programming tool for FTDI-based Lattice iCE programmers
*
* Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
* Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
* Copyright (C) 2018 Piotr Esden-Tempski <piotr@esden.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
@ -549,14 +549,14 @@ static void help(const char *progname)
fprintf(stderr, " programming the flash chip and one zero ohm resistor must be desoldered\n");
fprintf(stderr, " and the FT2232H SI pin must be connected to the iCE SPI_SI pin, as shown\n");
fprintf(stderr, " in this picture:\n");
fprintf(stderr, " http://www.clifford.at/gallery/2014-elektronik/IMG_20141115_183838\n");
fprintf(stderr, " https://github.com/yosyshq/icestorm/blob/master/docs/source/_static/images/icestick.jpg\n");
fprintf(stderr, "\n");
fprintf(stderr, "Notes for the iCE40-HX8K Breakout Board:\n");
fprintf(stderr, " Make sure that the jumper settings on the board match the selected\n");
fprintf(stderr, " mode (SRAM or FLASH). See the iCE40-HX8K user manual for details.\n");
fprintf(stderr, "\n");
fprintf(stderr, "If you have a bug report, please file an issue on github:\n");
fprintf(stderr, " https://github.com/cliffordwolf/icestorm/issues\n");
fprintf(stderr, " https://github.com/YosysHQ/icestorm/issues\n");
}
int main(int argc, char **argv)

View File

@ -1,7 +1,7 @@
/*
* iceprog -- simple programming tool for FTDI-based Lattice iCE programmers
*
* Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
* Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
* Copyright (C) 2018 Piotr Esden-Tempski <piotr@esden.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
@ -360,4 +360,4 @@ void mpsse_close(void)
ftdi_disable_bitbang(&mpsse_ftdic);
ftdi_usb_close(&mpsse_ftdic);
ftdi_deinit(&mpsse_ftdic);
}
}

View File

@ -1,7 +1,7 @@
/*
* iceprog -- simple programming tool for FTDI-based Lattice iCE programmers
*
* Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
* Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
* Copyright (C) 2018 Piotr Esden-Tempski <piotr@esden.net>
*
* Permission to use, copy, modify, and/or distribute this software for any

View File

@ -1,5 +1,5 @@
//
// Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
// Copyright (C) 2015 Claire Xenia Wolf <claire@clairexen.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above

View File

@ -1,7 +1,7 @@
/*
* yosys -- Yosys Open SYnthesis Suite
*
* Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
* Copyright (C) 2012 Claire Xenia Wolf <claire@clairexen.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above