Author Topic: Lattice Radiant for iCE40UP FPGA series  (Read 13730 times)

0 Members and 1 Guest are viewing this topic.

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #25 on: December 21, 2018, 04:44:54 am »
yes but on comment 3, you discuss ice40 ultra plus 5k breakout board where FTDI is already soldered. i have my own PCB and am trying to JTAG it by  HW-USBN-2B programmer. i did followed  HW-USBN-2 pinout manual, and connected soft jtag pins according to it. but when i try to analyze it by reveal analyzer it gives error: "incorrect pattern readout" . error log file shows readout:

#pattern readout = ffff
#pattern expected = A5A5

Is the FPGA programmed with a design that includes the Reveal debug logic?
 

Offline ilik

  • Contributor
  • Posts: 11
  • Country: ge
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #26 on: December 21, 2018, 05:46:21 am »
yes, by a .bin progrmming file that gets generated in the impl_1 folder where the design resides; and  i can see it in a netlist viewer (both soft jtag and reveal are observable).there is huge lcell use in the floorplan editor; timing analysis passes without violations.

if it really is a synthesis problem then compiling the project by LSE and Synplify should have given different results. but both end up the same way so i doubt that it is syntheis related.

i also tried example project that came with Radiant. a counter with reveal already set up in it. project compiles, programs, the LED blinks, Reveal analyzer gives same "incorrect pattern readout" error.
changing soft jtag input pin's pull-up internal resistors from 100k ohm to 10k ohm gave zero results (tried it just in case).

does it matter if the programming file is a binary (.bin) or a raw bit file (.rbf)? both should be ok with reveal analyzer no?
since the pcb was developed by me, i must assume that it is an electrical or pin connection problem that sneaked out somewhere on the design stage :(((


i should have checked the Tech support unavailability before messing with lattice (intel is a same donkey regarding tech support).

« Last Edit: December 21, 2018, 05:58:03 am by ilik »
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #27 on: December 21, 2018, 06:23:28 am »
You mention the internal oscillator as your clock source. At least in the MacoXO2, the system clock of your design has to be higher than the jtag clock. If you are clocking your logic with say 1 MHz, reveal analyzer doesn't work. Could it be an issue ?
 

Offline ilik

  • Contributor
  • Posts: 11
  • Country: ge
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #28 on: December 21, 2018, 07:23:26 am »
as i recall it from yesterday evening, JTAG clock coming from the programmer was ~12.2MHZ. internal oscillator runs at 48MHz.
i knew that reveal's sampling clock must be at least twice or more greater than soft jtag clock.
i'm telling you i thought about everything. that's why i have no other choice to ask for help, i'm out of ideas:(((


(PS. lattice won't bother to help developing engineers like me, then they complain that their sales won't grow,they fall; and try to sell themselves to chinese, then congress bans the acquisition and puts them down back on their place. then a fool like me put's he's hands where he shouldn't and here is the result :))
« Last Edit: December 21, 2018, 08:06:47 am by ilik »
 

Offline iMoTopic starter

  • Super Contributor
  • ***
  • Posts: 4675
  • Country: nr
  • It's important to try new things..
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #29 on: December 21, 2018, 08:44:52 am »
Quote
yes but on comment 3, you discuss ice40 ultra plus 5k breakout board where FTDI is already soldered.
I was using a plain 5k board (UPduino v1) with an external cheapo FT232H breakout board, afaik. There is a wiring description you may see in Reply #3.
As indicated you may define the pin layout of the soft-jtag (and build with your own). Doublecheck your setting again and try with the example project. It simply worked first time..

PS: Their tech support - simply register yourself and you will get the support. I had about a dozen of requests to the TS. They started to deal with the tickets always within 24h.
« Last Edit: December 21, 2018, 09:11:51 am by imo »
 

Offline ilik

  • Contributor
  • Posts: 11
  • Country: ge
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #30 on: December 21, 2018, 10:19:36 am »
Quote
PS: Their tech support - simply register yourself and you will get the support. I had about a dozen of requests to the TS. They started to deal with the tickets always within 24h.

okay....
their tech support gives this warning:
"Thank you for contacting Lattice Technical Support.

Our system has identified your email ID as a public domain email ID or an university email ID.
To obtain Lattice Technical support, you must register under your company name
with your official company email ID and other company details.
If you do not have an official (company) email ID, you can use our extensive online resources to address your queries.
We do not provide technical support to tickets with public (e.g. gmail.com, yahoo.com etc…) or university (.edu) domains. "

i don't own any company. besides, i live outside of US, and they have some legal restrictions on working with non US individuals.
but thanks for the help anyway. i guess i'll have to continue without internal debugging capabilities.
 

Offline iMoTopic starter

  • Super Contributor
  • ***
  • Posts: 4675
  • Country: nr
  • It's important to try new things..
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #31 on: December 21, 2018, 10:42:41 am »
A good engineering practice is not to use high clock freqs when you see some issues. Start with 24MHz internal oscillator, and set jtag clock to 100kHz or something like that. Again, do not expect messing with FPGAs is as simple as blinking the led with an arduino.. :)
I got similar issues many times, spending weeks debugging a pretty simple stuff, while messing with Actels/Xilinxes/Lattices, and the problem was always at my side. :palm:.
« Last Edit: December 21, 2018, 11:15:03 am by imo »
 

Offline ilik

  • Contributor
  • Posts: 11
  • Country: ge
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #32 on: December 21, 2018, 11:10:59 am »
I got similar issues many times, spending weeks debugging a pretty simple stuff, while messing with Actels/Xilinxes/Lattices, and the problem was always at my side. :palm:.

eh... True, True,

Quote
set jtag clock to 100kHz or something like that.

hmm..., i am using a HW-USBN-2B programmer, there is no way to tell it to lower it's output TCK frequency.
« Last Edit: December 21, 2018, 11:13:56 am by ilik »
 

Offline iMoTopic starter

  • Super Contributor
  • ***
  • Posts: 4675
  • Country: nr
  • It's important to try new things..
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #33 on: December 21, 2018, 11:16:15 am »
My lesson learned - do always review the reports after a build, line by line (!!).
It happens the system tells you "we have done this and this because of that.." and it happily builds a bitstream for you.

A single typo in verilog source (in the inputs/outputs signal "name", for example, and always with missing clock wiring somewhere between the modules) may lead to a situation the system optimizes a part of your design out, while you will not get an error message, and the resulting bitstream builds fine.
 

Offline iMoTopic starter

  • Super Contributor
  • ***
  • Posts: 4675
  • Country: nr
  • It's important to try new things..
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #34 on: December 21, 2018, 11:29:15 am »
Quote
set jtag clock to 100kHz or something like that.
hmm..., i am using a HW-USBN-2B programmer, there is no way to tell it to lower it's output TCK frequency.
Open the "Radiant Programmer" (from inside the Radiant) and try to set the TCLK divider.

« Last Edit: December 21, 2018, 11:55:56 am by imo »
 

Offline ilik

  • Contributor
  • Posts: 11
  • Country: ge
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #35 on: December 21, 2018, 11:55:54 am »
WOW THANKS MAN!  i'm coming from altera and am not familiar with lattice's tips and tricks. one more issue i'd like to mention here:

ice40 ultra plus is programmed by SPI, not JTAG. so the programmer boots it up in a SPI mode. my SPI SI,SO and SCK pins come from programmer and enter the fpga. the thing is that SI,SO and SCK 's JTAG equivalent are TDI TDO and TCK which interestingly enough are one and the same pins on the programmer. so inside Radiant software i have targeted soft jtag's  TDI TDO and TCK on same pins as the dedicated SI,SO and SCK pins are. datasheet states that after programming ends, and fpga enters a User mode, these programming pins may be used as regular IO pins. that is why i decided to target TDI TDO and TCK to these pins. this way i don't have to relocate programmer's pins after programming, and try to take the analyzer sample straight away.
so if we follow the logical thinking:
first, these programming pins serve as a dedicated SPI programming pins, i program the device, then the fpga switches to user mode and these pins become connected to soft jtag's  TDI TDO and TCK right? (because i connected them this way inside the project). now i try to use reveal analyzer and the error comes. of course i also have TMS signal connected on one of the pins on the fpga, i did not left it out.

is there something wrong with this design?
« Last Edit: December 21, 2018, 12:00:47 pm by ilik »
 

Offline iMoTopic starter

  • Super Contributor
  • ***
  • Posts: 4675
  • Country: nr
  • It's important to try new things..
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #36 on: December 21, 2018, 12:06:02 pm »
I can confirm the 4 SPI programming pins are accessible off the userland (I've been using them in my design for writing/reading user data into/from the external SPI bitstream flash, different location than the bitstream, of course).

After the UP5k reads the bitstream it "boots itself", then it waits 100clocks, and then it enables the 4 SPI programming pins for the user.

I cannot remember whether I used the SPI programming pins for the soft-jtag (look at my wiring above), though.

Doublecheck your wiring as the UP5k may work during the reading the bitstream (called "configuration") as the "SPI Slave" or "SPI Master" .

BTW, do you use an external SPI bitstream flash memory for storing the bitstream??
The iCE40UP5k has not got an internal flash for the bitstream (nor any iCE40xxx)..  :(

Anyhow, I would highly recommend you to read the programming/configuration app note - "Technical Note TN1248" carefully  ;)


« Last Edit: December 21, 2018, 12:58:07 pm by imo »
 

Offline ilik

  • Contributor
  • Posts: 11
  • Country: ge
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #37 on: December 21, 2018, 01:39:58 pm »
Quote
BTW, do you use an external SPI bitstream flash memory for storing the bitstream??
The iCE40UP5k has not got an internal flash for the bitstream (nor any iCE40xxx)..  :(

HuH?!
document TN1248 on Page 11 tells that:

This section applies to iCE40 LP, iCE40 HX, iCE40 Ultra, iCE40 UltraLite and iCE40 UltraPlus devices only.
All standard iCE40 devices have an internal NVCM. The NVCM is large enough to program a complete iCE40 device,
including initializing all Embedded Block RAM.  circuitry.   

isn't NVCM a Non Voletile Configuration Memory?  so it has it -no?
 

Offline iMoTopic starter

  • Super Contributor
  • ***
  • Posts: 4675
  • Country: nr
  • It's important to try new things..
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #38 on: December 21, 2018, 02:06:03 pm »
Yes, NVCM is one time programmable..
 

Offline ilik

  • Contributor
  • Posts: 11
  • Country: ge
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #39 on: December 21, 2018, 02:10:23 pm »
Yes, NVCM is one time programmable..

oh you mean that. ook ok.
 

Offline iMoTopic starter

  • Super Contributor
  • ***
  • Posts: 4675
  • Country: nr
  • It's important to try new things..
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #40 on: December 21, 2018, 02:26:08 pm »
For a development work you may:
1. attach an external 8pin SPI flash (ie. the one UPduino is using) and the iCE boots from it automatically upon reset or power-on (your programmer can program the external SPI flash),
2. use an MCU which uploads the bitstream into the iCE (volatile),
3. use the programmer to upload the bitstream into the iCE (volatile).

When you flash your bitstream into the NVCM, you cannot overwrite it anymore..
« Last Edit: December 21, 2018, 02:29:33 pm by imo »
 

Offline ilik

  • Contributor
  • Posts: 11
  • Country: ge
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #41 on: December 24, 2018, 06:10:08 am »
one time programability is fine for me. i have a little different headache, Floor planner.
Floorplan view Grouping. i have grouped a whole instance in a single group (called "grp"), anchored it somewhere in the middle of the IC. and it says:

WARNING - The group 'grp' constraint has more than 32 comps in the group.
This group will not be applied to placement.
INFO - LOCATE GROUP 'grp' constraint is removed because it is not placeable.

i'm 100% certain that the group is large enough to accommodate all the lcells.
can't believe Radiant's floorplan won't group instances that contain more than 32 logic cells in it. i guess a word "comps" mean something else that i'm not aware of.
any thoughts what it might be?

unfortunately lattice did no release their error/warning explanations document where i could read what does this warning mean and how can i defeat it.
 

Offline kjertil

  • Newbie
  • Posts: 2
  • Country: se
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #42 on: March 27, 2019, 02:02:14 pm »
*EDIT*

Shortly after posting a rant i think i now understand the problem with Reveal in Radiant using the ICE40 UP5 breakout board:

The problem is that the board doesn't connect the FTDI to JTAG, there's only the SPI bus for flash programming.

My solution:

1. Add the Reveal IP (Inserter)
2. Compile (synthesize)
3. IMPORTANT -> set the JTAG pins to the pin headers for connection to an external JTAG connection
4. Export bit stream file (full compilation)
5. Use on board USB FTDI to upload bit stream(as normal)
6. Connect yet another ispDownload cable (HW-USBN-2B from Ebay) and start Reveal Analyser

This solution requires an external JTAG / ispDownload cable / programmer. If anyone knows a short cut to use the on board FTDI chip, please feel free to fill in!


If there's no way to use the FTDI chip for JTAG on the ICE40 UP5 break out bard i must say Lattice won't get any of my bonus points today. How ever, they provide very affordable FPGA chips so i guess this is what we have to live with.


« Last Edit: March 27, 2019, 06:26:58 pm by kjertil »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14309
  • Country: fr
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #43 on: March 27, 2019, 04:49:24 pm »
If anyone's interested, a while ago I ported (and slightly modified I think) a very simple test project for the Upduino 2.0 (RGB controller) for Radiant using VHDL. Maybe that could get some people started.

Top (VHDL):
Code: [Select]
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;

library iCE40UP;
use iCE40UP.Components.all;

--******************************************************************************

entity TestRGB is
generic
(
nPWMCounterBits : integer := 13
);

port
(
RESETn : in std_logic;

LED_REDn : out std_logic;
LED_GREENn : out std_logic;
LED_BLUEn : out std_logic
);
end TestRGB;

--******************************************************************************

architecture Behavioral of TestRGB is

signal LF_Clock : std_logic;
signal nPWM_Cnt : unsigned((nPWMCounterBits - 1) downto 0);
signal PWM_Red, PWM_Green, PWM_Blue : std_logic;

begin

-- On-Chip Oscillator (LSOSC): Low Frequency Oscillator, 10 kHz.
LSOSC_1: LSOSC
port map (CLKLFEN => '1', CLKLF => LF_Clock, CLKLFPU => '1');

-- RGB Driver.
RGB_Driver_1 : RGB
generic map
(
CURRENT_MODE => "0",
RGB0_CURRENT => "0b000001",
RGB1_CURRENT => "0b000001",
RGB2_CURRENT => "0b000001"
)
port map
(
RGBLEDEN => RESETn, CURREN => RESETn,
RGB0PWM => PWM_Red, RGB1PWM => PWM_Green, RGB2PWM => PWM_Blue,
RGB0 => LED_REDn, RGB1 => LED_GREENn, RGB2 => LED_BLUEn
);

-- PWM Counter.
PWM_Counter: process (RESETn, LF_Clock)
begin
if RESETn = '0' then
nPWM_Cnt <= (others => '0');
elsif rising_edge(LF_Clock) then
nPWM_Cnt <= nPWM_Cnt + 1;
end if;
end process PWM_Counter;

-- PWM Control.
PWM_Red <= nPWM_Cnt(nPWMCounterBits - 1) and nPWM_Cnt(nPWMCounterBits - 2);
PWM_Green <= nPWM_Cnt(nPWMCounterBits - 1) and (not nPWM_Cnt(nPWMCounterBits - 2));
PWM_Blue <= (not nPWM_Cnt(nPWMCounterBits - 1)) and nPWM_Cnt(nPWMCounterBits - 2);

end Behavioral;

--******************************************************************************

.pdc file:
Code: [Select]
ldc_set_location -site {37} [get_ports RESETn]
ldc_set_location -site {39} [get_ports LED_REDn]
ldc_set_location -site {40} [get_ports LED_GREENn]
ldc_set_location -site {41} [get_ports LED_BLUEn]
ldc_set_port -iobuf {IO_TYPE=LVCMOS33 PULLMODE=100K} [get_ports RESETn]
 
The following users thanked this post: helius, ebastler

Offline Ice-Tea

  • Super Contributor
  • ***
  • Posts: 3063
  • Country: be
    • Freelance Hardware Engineer
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #44 on: April 16, 2019, 06:32:22 pm »
Code: [Select]
library iCE40UP;
use iCE40UP.Components.all;

Had been looking for that.. But it still doesn't work for me. Synplify gives me:

ERROR - Tek_impl_1.vm(5829): instantiating unknown module HFOSC

Lattice LSE:

child killed: segmentation violation

Fail to run synthesis -f Tek_impl_1_lattice.synproj -gui -msgset {C:/Users/Kris Verbeeck/Dropbox/Projects/PAL/Lattice2/Tek/promote.xml}
Done: error code 1

Tried to include the Ice40Up.vhd file to the project, no dice. What am I missing? How do I make sure the package is included?



Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14309
  • Country: fr
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #45 on: April 16, 2019, 11:08:57 pm »
Don't know why LSE crashes (that's bad), but if you copied and pasted your error message verbatim, then your mistake is that there is no "HFOSC" primitive indeed.

You need to take a look at the Radiant's new primitives (can be found in Radiant's help.)
The primitive name of the high frequency oscillator is "HSOSC".

You don't need to explicitely include the Ice40Up.vhd file in your project.
 
The following users thanked this post: Ice-Tea

Offline Ice-Tea

  • Super Contributor
  • ***
  • Posts: 3063
  • Country: be
    • Freelance Hardware Engineer
Re: Lattice Radiant for iCE40UP FPGA series
« Reply #46 on: April 17, 2019, 06:52:56 am »
I think I'll just go jump of a bridge now

EDIT: to be clear, because I made a typo (HFOSC iso HSOSC). Not because Siliconwizards suggestions were not helpfull.
« Last Edit: April 21, 2019, 08:30:28 am by Ice-Tea »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf