Skip to content

Commit

Permalink
Nes project for logipi raspberry pi communication
Browse files Browse the repository at this point in the history
  • Loading branch information
jpiat committed Sep 4, 2015
1 parent 1508986 commit bed4537
Show file tree
Hide file tree
Showing 11 changed files with 897 additions and 0 deletions.
14 changes: 14 additions & 0 deletions logipi-gpio_example/hw/hdl/logipi_gpio.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Blink two LEDs
// (c) KNJN LLC - fpga4fun.com

module logipi_gpio(OSC_FPGA, LED, rpi_gpio);
input OSC_FPGA;
input rpi_gpio;
output [1:0] LED;

reg [31:0] cnt;
always @(posedge OSC_FPGA) cnt <= cnt + 32'h1;
assign LED[0] = ~cnt[22] & ~cnt[20];
// LED1 depends on RPi GPIO
assign LED[1] = cnt[25-(rpi_gpio << 2)];
endmodule
56 changes: 56 additions & 0 deletions logipi-gpio_example/hw/hdl/logipi_gpio.vhd
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 13:38:40 09/04/2015
-- Design Name:
-- Module Name: logipi_gpio - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity logipi_gpio is
port(
OSC_FPGA : in std_logic ;
rpi_gpio : in std_logic ;
led : out std_logic_vector(1 downto 0)
);
end logipi_gpio;

architecture Behavioral of logipi_gpio is
signal cnt : std_logic_vector(31 downto 0);
begin

process(OSC_FPGA)
begin
if OSC_FPGA'event and OSC_FPGA = '1' then
cnt <= cnt + 1 ;
end if ;
end process ;


LED(0) <= not(cnt(22)) and not(cnt(20));
LED(1) <= cnt(25) when rpi_gpio = '0' else
cnt(25 - 4) ;
end Behavioral;

15 changes: 15 additions & 0 deletions logipi-gpio_example/hw/hdl/logipi_r1_5.ucf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
##### Grouping Constraints #####
NET OSC_FPGA TNM_NET = clk50_grp;

##### Clock Period Constraints #####
TIMESPEC TS_PER_CLK50 = PERIOD "clk50_grp" 20.0 ns;

#######################
# Pin LOC Constraints #
######################

##### Bank 2 #####
NET "LED<0>" LOC = "P105" | IOSTANDARD = LVTTL; #SHARED WITH ARD_D6
NET "LED<1>" LOC = "P104" | IOSTANDARD = LVTTL; #SHARED WITH ARD_D7
NET "RPI_GPIO" LOC = "P81" | IOSTANDARD = LVTTL; #SHARED WITH ARD_D7
NET "OSC_FPGA" LOC = "P85" | IOSTANDARD = LVTTL;
77 changes: 77 additions & 0 deletions logipi-gpio_example/hw/ise/iseconfig/logipi_gpio.projectmgr
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!--This is an ISE project configuration file.-->
<!--It holds project specific layout data for the projectmgr plugin.-->
<!--Copyright (c) 1995-2009 Xilinx, Inc. All rights reserved.-->
<Project version="2" owner="projectmgr" name="logipi_gpio" >
<!--This is an ISE project configuration file.-->
<ItemView engineview="SynthesisOnly" guiview="Source" compilemode="AutoCompile" >
<ClosedNodes>
<ClosedNodesVersion>2</ClosedNodesVersion>
</ClosedNodes>
<SelectedItems>
<SelectedItem>logipi_gpio (/home/jpiat/development/FPGA/logi-family/logi-projects/logipi-gpio_example/hw/hdl/logipi_gpio.v)</SelectedItem>
</SelectedItems>
<ScrollbarPosition orientation="vertical" >0</ScrollbarPosition>
<ScrollbarPosition orientation="horizontal" >0</ScrollbarPosition>
<ViewHeaderState orientation="horizontal" >000000ff000000000000000100000001000000000000000000000000000000000202000000010000000100000064000000fc000000020000000000000000000000000200000064ffffffff000000810000000300000002000000fc0000000100000003000000000000000100000003</ViewHeaderState>
<UserChangedColumnWidths orientation="horizontal" >true</UserChangedColumnWidths>
<CurrentItem>logipi_gpio (/home/jpiat/development/FPGA/logi-family/logi-projects/logipi-gpio_example/hw/hdl/logipi_gpio.v)</CurrentItem>
</ItemView>
<ItemView engineview="SynthesisOnly" sourcetype="" guiview="Process" >
<ClosedNodes>
<ClosedNodesVersion>1</ClosedNodesVersion>
<ClosedNode>Design Utilities</ClosedNode>
</ClosedNodes>
<SelectedItems>
<SelectedItem></SelectedItem>
</SelectedItems>
<ScrollbarPosition orientation="vertical" >0</ScrollbarPosition>
<ScrollbarPosition orientation="horizontal" >0</ScrollbarPosition>
<ViewHeaderState orientation="horizontal" >000000ff000000000000000100000001000000000000000000000000000000000000000000000000f2000000010000000100000000000000000000000064ffffffff000000810000000000000001000000f20000000100000000</ViewHeaderState>
<UserChangedColumnWidths orientation="horizontal" >false</UserChangedColumnWidths>
<CurrentItem></CurrentItem>
</ItemView>
<ItemView guiview="File" >
<ClosedNodes>
<ClosedNodesVersion>1</ClosedNodesVersion>
</ClosedNodes>
<SelectedItems/>
<ScrollbarPosition orientation="vertical" >0</ScrollbarPosition>
<ScrollbarPosition orientation="horizontal" >0</ScrollbarPosition>
<ViewHeaderState orientation="horizontal" >000000ff0000000000000001000000000000000001000000000000000000000000000000000000028a000000040101000100000000000000000000000064ffffffff0000008100000000000000040000005100000001000000000000002900000001000000000000008400000001000000000000018c0000000100000000</ViewHeaderState>
<UserChangedColumnWidths orientation="horizontal" >false</UserChangedColumnWidths>
<CurrentItem></CurrentItem>
</ItemView>
<ItemView guiview="Library" >
<ClosedNodes>
<ClosedNodesVersion>1</ClosedNodesVersion>
<ClosedNode>work</ClosedNode>
</ClosedNodes>
<SelectedItems/>
<ScrollbarPosition orientation="vertical" >0</ScrollbarPosition>
<ScrollbarPosition orientation="horizontal" >0</ScrollbarPosition>
<ViewHeaderState orientation="horizontal" >000000ff00000000000000010000000000000000010000000000000000000000000000000000000128000000010001000100000000000000000000000064ffffffff000000810000000000000001000001280000000100000000</ViewHeaderState>
<UserChangedColumnWidths orientation="horizontal" >false</UserChangedColumnWidths>
<CurrentItem>work</CurrentItem>
</ItemView>
<ItemView engineview="SynthesisOnly" sourcetype="DESUT_VERILOG" guiview="Process" >
<ClosedNodes>
<ClosedNodesVersion>1</ClosedNodesVersion>
<ClosedNode>Configure Target Device</ClosedNode>
<ClosedNode>Design Utilities</ClosedNode>
<ClosedNode>Implement Design</ClosedNode>
<ClosedNode>Synthesize - XST</ClosedNode>
<ClosedNode>User Constraints</ClosedNode>
</ClosedNodes>
<SelectedItems>
<SelectedItem>Generate Programming File</SelectedItem>
</SelectedItems>
<ScrollbarPosition orientation="vertical" >0</ScrollbarPosition>
<ScrollbarPosition orientation="horizontal" >0</ScrollbarPosition>
<ViewHeaderState orientation="horizontal" >000000ff000000000000000100000001000000000000000000000000000000000000000000000000f2000000010000000100000000000000000000000064ffffffff000000810000000000000001000000f20000000100000000</ViewHeaderState>
<UserChangedColumnWidths orientation="horizontal" >false</UserChangedColumnWidths>
<CurrentItem>Generate Programming File</CurrentItem>
</ItemView>
<SourceProcessView>000000ff00000000000000020000014c0000011d01000000060100000002</SourceProcessView>
<CurrentView>Implementation</CurrentView>
</Project>
Loading

0 comments on commit bed4537

Please sign in to comment.