8000 GitHub - toms74209200/FIB: Fibonacci function in VHDL · GitHub
[go: up one dir, main page]

Skip to content
toms74209200Public

About

Fibonacci function in VHDL

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FIB

Fibonacci function sample. This module is received index n, returns Fibonacci number corresponding to n.

$F_n = F_{n-1} + F_{n-2}$

Interface is Avalon-ST.

Interface

Name Width I/O P/N Description
RESET_n 1 I N Reset
CLK 1 I P Clock
ASI_READY 1 O P Avalon-ST sink data ready
ASI_VALID 1 I P Avalon-ST sink data valid
ASI_DATA 31:0 I P Avalon-ST sink data: index n
ASO_VALID 1 O P Avalon-ST source data valid
ASO_DATA 31:0 O P Avalon-ST source data: Fibonacci number
ASO_ERROR 1 O P Avalon-ST source error

Data width is parameterized with DW.

interface wave diagram

The description of Avalon-ST is introduced in references[1].

ASI_DATA is index n, up to 0d47. It is limited by the maximum value that can be represented by the data width of ASO_DATA.

ASO_ERROR is asserted by the following conditions:

  • Index n is out of range
  • Calculation is overflow

Project operation

Build Quartus project

Make project and add VHDL source file.

$quartus_sh.exe --tcl_eval project_new FIB
$echo "set_global_assignment -name VHDL_FILE pld/FIB.vhd" >> FIB.qsf

Compile project

$make
quartus_sh.exe --flow compile FIB

Run ModelSim simulation

$make check

If you rewrite the following statement in Makefile, GUI simulation runs.

Makefile(l.40)

-- 	vsim.exe -c -msgmode both -displaymsgmode both TB_$(PROJECT) $(MODELSIM_DO_FLAGS)
++ 	vsim.exe -msgmode both -displaymsgmode both TB_$(PROJECT) $(MODELSIM_DO_FLAGS)

Operating environment

  • Quartus Prime 18.0.0 Build 614 04/24/2018 SJ Lite Edition
  • ModelSim - Intel FPGA Starter Edition 10.5b 2016.10
  • Altera Nios2 Command Shell 18.0 Build 614 or Windows Subsystem for Linux(WSL) Ubuntu 16.04.6 LTS

Reference

[1] 5. Avalon Streaming Interfaces - Avalon Interface Specifications

License

MIT License

Author

toms74209200

About

Fibonacci function in VHDL

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0