Skip to content

PR to update the tutorial Makefiles #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jaimebw opened this issue Mar 22, 2025 · 1 comment
Open

PR to update the tutorial Makefiles #32

jaimebw opened this issue Mar 22, 2025 · 1 comment

Comments

@jaimebw
Copy link

jaimebw commented Mar 22, 2025

Hi Obijuan,
First of all, thanks for the awesome tutorial. It is really helping me start my (open-source) journey with FPGAs.
I don't know if you would be interested in updating some of the Makefiles/docs for some updated resources.
Mainly, arachne-pnr is no longer supported, so I have been updating everything to use a nextpnr.
I can definitely try to push the changes once I've gone through the whole tutorial.

@jaimebw
Copy link
Author

jaimebw commented Mar 22, 2025

The main changes are like from this:

#-- Compilar
iverilog $^ -o $(NAME)_tb.out
#-- Simular
./$(NAME)_tb.out
#-- Ver visualmente la simulacion con gtkwave
gtkwave $@ $(NAME)_tb.gtkw &

To something like this:

	#-- Compilar
	iverilog -o $(NAME)_tb.out $(NAME)_tb.v $(NAME).v
	#-- Simular
	./$(NAME)_tb.out
	
	#-- Ver visualmente la simulacion con gtkwave
	gtkwave $@ $(NAME)_tb.gtkw &

Same here:

$(NAME).bin: $(NAME).pcf $(NAME).v
#-- Sintesis
yosys -p "synth_ice40 -blif $(NAME).blif" $(NAME).v
#-- Place & route
arachne-pnr -d 8k -p $(NAME).pcf $(NAME).blif -o $(NAME).txt
#-- Generar binario final, listo para descargar en fgpa
icepack $(NAME).txt $(NAME).bin

To something like this:

	#-- Sintesis
	yosys -p "synth_ice40 -top $(NAME) -json $(NAME).json" $(NAME).v
	
	#-- Place & route

	nextpnr-ice40 --lp1k --json $(NAME).json --pcf $(NAME).pcf --asc $(NAME).asc
	#-- Generar binario final, listo para descargar en fgpa
	icepack $(NAME).asc $(NAME).bin

I'm currently running under MacOs.

Also, there are some issues when I compile Verilog. Mainly, it has to do with re-declaring wires like in:

module Fport(output [3:0] data);
//-- La salida del modulo son 4 cables
wire [3:0] data;
//-- Sacar el valor por el bus de salida
//-- En verilog se indica primero el numero de bits
//-- y luego el formato (binario, hexa, decimal, etc...)
//-- Para sacar el valor en hexa hay que poner: 4'h4
assign data = 4'b1010; //-- 4'hA
endmodule

It complains and I have read that the newer standards do not let you declare explicitly that way. Corrected (more like more correct example):

odule Fport(output [3:0] data);

  //-- La salida del modulo son 4 cables
  //wire [3:0] data;

  //-- Sacar el valor por el bus de salida
  //-- En verilog se indica primero el numero de bits
  //-- y luego el formato (binario, hexa, decimal, etc...)
  //-- Para sacar el valor en hexa hay que poner: 4'h4
  assign data = 4'b1010; //-- 4'hA

endmodule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant