Click here to Skip to main content
15,896,154 members
Articles / Programming Languages / CUDA

Convert Xilinx FPGA/CPLD to C Source

Rate me:
Please Sign up or sign in to vote.
4.71/5 (6 votes)
28 May 2011CPOL12 min read 52K   1.7K   12  
Flow and tools to convert Xilinx bitstreams to C source code for programming FPGA/CPLD
--------------------------------------------------------------------------------------------
-- Company     : ILIALEX RESEARCH LAB
-- Project     : AVRILOS FPGA
-- Proj. Code  : HDL-IOSS0002ILX
-- Title       : Serial Synchronous Interface, SSIBITCNT
-- Description : SSI Bit counter in order to dermine when to do various ops.
-- File        : ssibitcnt.vhd
-- Type        : VHDL
-- Library     : IRL - VHDL, Project Lib
-- Author      : Alexopoulos Ilias
-- Comments    :
--
-- Dependencies:
--
-- Revisions   :
-- Version     : (Version) (dd/mm/yy) changes
--					0.00	11/5/2002 	First implementation
--					1.00    01/03/2010  Added documentation for AVRILOS
--
-- Generic:
--
-- Inputs:
--		rstb			: Reset (bar), negative active
--      Clk				: System Clock
--      MCUClk_En		: Pulse (1 system clock) on rising edge of Ext_MCUClk
--		start			: signal to enable counting in bitcnt. Stop counting on end or MCUFrame off.
--
-- Outputs:
--
--		addr_ok			: Address ready to capture (valid)
--		data_ok			: Data from MOSI ready to be used
--
--
--
--
-- Notes on design:
--
-- Support E-mail: avrilos@ilialex.gr
-- license: See license.txt on root directory (CPOL)
--------------------------------------------------------------------------------------------


LIBRARY IEEE;
USE IEEE.std_logic_1164.all;
USE ieee.std_logic_arith.all;

ENTITY ssibitcnt IS
    PORT (
    	rstb: 		IN std_logic;
        clk:		IN std_logic;

        mcuclk_en: 	IN std_logic;
        start: 		IN std_logic;

        bitcnt: 	OUT std_logic_vector(4 DOWNTO 0)

    );
END ssibitcnt;

ARCHITECTURE rtl OF ssibitcnt IS

SIGNAL bitcnt_sig:		unsigned(bitcnt'range);
SIGNAL clk_en:			std_logic;

BEGIN

clk_en	<= mcuclk_en;

PROCESS(rstb, clk)
BEGIN
	IF rstb = '0' THEN
		bitcnt_sig 			<= (OTHERS => '0');
	ELSIF rising_edge(clk) THEN

		IF start = '1' THEN
				
			IF clk_en = '1' THEN
				IF bitcnt_sig = 16 THEN
				ELSE
					bitcnt_sig <= bitcnt_sig + 1;
				END IF;
			END IF;
		ELSE
			bitcnt_sig	 		<= (OTHERS => '0');
		END IF;

	END IF;

END PROCESS;

bitcnt <= std_logic_vector(bitcnt_sig);

END rtl;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Systems Engineer AI ZeroCaliber Ltd
Cyprus Cyprus
More than 15 year of Embedded Systems development designing both hardware & software.
Experience with Product Development,lab prototypes and Automated Testers, Sensors, motors and System Engineering. Have used numerous micro-controllers/processors, DSP & FPGAs.

Please check AI ZeroCaliber if you need any help.
You may find also my personal site: Ilialex and my blog site: Ilialex Blog

Comments and Discussions