Code block in icestudio

Hi,
I'm trying to program a TinyFPGA BX to provide 3 registers to emulate an
FDC9266, the bulk will later be done using an ATMega ucontroller.
To sort out the A0,nCS,nRD,nWR,nDACK, I have inserted a code block which
should generate the following internal signals:
SEL: switch a "Mux 2:1" between the outputs of the STATUS and the DATA
IN registers
OE: enable a TRI-STATE output to the processor's data bus
DW: clock data into the DATA IN register
?if (nCS == 0 || nDACK == 0) // chip selected
begin
SEL = A0; // (1)
OE = not nRD; // (2)
DW = not nWR; // (3)
end
I keep getting errors "Invalid module instantiation" on lines (1), (2) ,
and (3) and "Syntax error" on line (1).
I cannot find a suitable syntax description, so I tried
* "
Reply to
Josef Moellers
Loading thread data ...
> Hi, > > I'm trying to program a TinyFPGA BX to provide 3 registers to emulate an > FDC9266, the bulk will later be done using an ATMega ucontroller. > > To sort out the A0,nCS,nRD,nWR,nDACK, I have inserted a code block which > should generate the following internal signals: > > SEL: switch a "Mux 2:1" between the outputs of the STATUS and the DATA > IN registers > OE: enable a TRI-STATE output to the processor's data bus > DW: clock data into the DATA IN register > > ?if (nCS == 0 || nDACK == 0) // chip selected > begin > SEL = A0; // (1) > OE = not nRD; // (2) > DW = not nWR; // (3) > end > > I keep getting errors "Invalid module instantiation" on lines (1), (2) , > and (3) and "Syntax error" on line (1). > I cannot find a suitable syntax description, so I tried > * "
Reply to
Josef Moellers
n
h
, > > and (3) and "Syntax error" on line (1). > > I cannot find a suitable syntax description, so I tried > > * "
Reply to
Rick C
[...] > You appear to be programming in Verilog which I don't know so well mostly having programmed in VHDL. I don't know that in Verilog assignment statements always have to be in a process (the always block thing). In VHDL the "top level" is to write independent assignment statements which all operate in parallel. Then inside a process (slightly different syntax from Verilog always blocks, it starts with process()) assignment statements are sequential code. > > To answer your question, there are two types of assignments, blocking and non-blocking. The nomenclature has never made sense to me so I don't remember which is which. Looking it up = is 'blocking' and In a process In a process an assignment using = in Verilog and := in VHDL is made immediately so that the value can be changed before reaching the end of the process. These are only used when you specifically need them for some reason. While they are more like what happens in non-hardware related code, HDLs mostly are coded with non-blocking assignments using
Reply to
Josef Moellers
ly having programmed in VHDL. I don't know that in Verilog assignment stat ements always have to be in a process (the always block thing). In VHDL th e "top level" is to write independent assignment statements which all opera te in parallel. Then inside a process (slightly different syntax from Veri log always blocks, it starts with process()) assignment statements are sequ ential code.
nd non-blocking. The nomenclature has never made sense to me so I don't re member which is which. Looking it up = is 'blocking' and
e immediately so that the value can be changed before reaching the end of t he process. These are only used when you specifically need them for some r eason. While they are more like what happens in non-hardware related code, HDLs mostly are coded with non-blocking assignments using
an HDL language and run with it. They actually need to learn the language and not assume it works like non-HDLs. Once they come to grips with a few differences like this, it's not so special and anyone can code in HDLs.
ng.
Have you ever worked with Forth? Being a hardware guy I find the interacti veness of Forth to be ideal for working with hardware. I can write code an d then thoroughly test it from the command line, essentially without a comp ile stage. More accurately, while other languages require a compiler to pr oduce an executable image a resident Forth compiler on the target allows th e code to be compiled during the source download with the compile being inv isible. Or you type in your definitions to be tested interactively.
It's more than I can explain in a couple of paragraphs, but it's very nice for interacting with hardware.
--
  Rick C. 

  + Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Rick C
During a period of practical work at NPL (the "National Physical Laboratories" in Teddington (UK)) in ... ohmygodwhenwasthat ... 1979, I worked in a team that developed and built the DEMOS Multicomputer: a multicomputer with a ring as the connection infrastructure. The computers were off-the-shelf Ferranti Argus 700F while the ring hardware was developed and built at NPL (the software was mostly done by London-based "SCICON Consultancy"). I was tasked with writing test software and, unknown to me at that time, I wrote a FORTH-like runtime system where the user could construct tests using predefined primitives and build on top of that. The primitives and the tests had a simple "verb argument(s)" syntax very much like FORTH. Later, when I realized that, I bought "Threaded Interpretative Languages" and tried to get that to run on a NASCOM I Z80-based microcomputer.
But, no, I never actually used FORTH. Lately, when I want to play around with hardware, I usually turn to a RasPi and control it using shell scripts and accesses to /sys/class/gpio.
From what I know about TILs in general and FORTH in particular, you're right. Maybe I should give it a try on my SB180FX whan I test the FDC-simulator.
Josef
Reply to
Josef Moellers
[...]
I've not tried the the gui from icestudio.io, but do use the command line core components of it. Email be if you'd like to see a typical Makefile, and escape the cage :-)
For a front end I use a python simulator, MyHDL[1]. This, with graphic waveform display can help locate problems quickly.
Your code seems to be missing an else clause to define the outputs when the peripheral chip is not being accessed.
Pasted below is a test script which simulates and tests the design, generates a file for waveform viewer, and verilog.
Jan Coombs
--
[1] MyHDL From Python to Silicon! 
myhdl.org 
 Click to see the full signature
Reply to
Jan Coombs
Thanks for the pointer! As for the CLI stuff: I'll come back later.
Josef
Reply to
Josef Moellers
activeness of Forth to be ideal for working with hardware. I can write cod e and then thoroughly test it from the command line, essentially without a compile stage. More accurately, while other languages require a compiler t o produce an executable image a resident Forth compiler on the target allow s the code to be compiled during the source download with the compile being invisible. Or you type in your definitions to be tested interactively.
ice for interacting with hardware.
You could fire up gForth on your rPi. The SB180FX appears to be a Z80 like home computer from very early days from what I can gather. If you ask on the Forth group or just use Google I am sure you will find many, many versi ons of Forth to play with, some ANSI (the current standard), some Forth-83 and likely FIG-Forth.
No shortage of candidates. comp.lang.forth.
--
  Rick C. 

  -- Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Rick C
Thanks for the pointers. As the Zsystem, which ist the SB180's main "OS" is upward compatible with CP/M, there is indeed no shortage of obsolete (not in the negative use of the word) software available for download. I even have a few CDs with PD software from Walnut Creek (anyone remember WC?).
Josef
Reply to
Josef Moellers
like home computer from very early days from what I can gather. If you ask on the Forth group or just use Google I am sure you will find many, many v ersions of Forth to play with, some ANSI (the current standard), some Forth -83 and likely FIG-Forth. >
I would ask if anyone remembers CDs! I've been looking for a new laptop an d it seems like the DVD/CD player is not fully deprecated. Amazing!
--
  Rick C. 

  -+ Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Rick C
I remember CD's - I have loads. (I don't know if I still have my original Walnut Creek CD - I bought my first CD-ROM player solely for use with that CD.) But I would not buy a laptop with a DVD drive now. A USB Bluray writer drive is simple, cheap, small, and handles everything of that kind of media. Buy it once, and use it on all your PC's and laptops.
Reply to
David Brown
+1
My wife an I have two laptops: an iBook and a DELL (running openSUSE Leap) and both are just too thin to actually put a disk reader/writer inside so I have bought an external drive that we can now use on both.
I vaguely recall that when CDROMs were first appearing, I got myself a SCSI-CDROM drive that I connected to the SB180FX (which has an NCR53C80 host adapter) and wrote some software to read files off CDROMs. I had to go around in the company I worked then to find the (was it a blue?) book of the standard to understand what I had to do.
Now you almost cannot even buy a SDcard with the capacity of a CDROM ;-)
Josef, feeling older every day!
Reply to
Josef Moellers
Exactly, you can buy a whole range of obsolete based peripherals with a USB interface from eBay for peanuts. I still have a floppy drive on a USB port (for some DOS stuff) and although it is slow it works fine.
I also recently bought a new USB cassette drive for my wife who still has some language courses on cassette, I think I pay less than 12 UK pounds for it.
Now finding a USB interface for my 8" floppy disks with Uniflex will be a challenge........
Hans
formatting link

Reply to
HT-Lab
I bought one of these at the office a few years back, after someone needed data from an old 3.5" floppy (we managed to get an old PC to boot and used that). I haven't even opened the box yet.
That sounds a good idea. We have piles of old cassettes - old music, and audio books.
I still have a VHS player connected to the telly, but it's been used only a handful of times in the last decade. We use DVDs, Blurays and audio CDs all the time.
The only 8" floppy I have has hung on the wall for 25 years - I doubt if anything could read it!
Reply to
David Brown
I agree, I have a whole box of 8" floppies which I am sure are all dead. I also have two 8" drives attached to a "Kees Schoenmaker" 6809 19" rack system which might still power up if I am very very very lucky. The system is close to 37 years old.
Ah...... the good old days :-)
Reply to
HT-Lab
Interesting. My friend is actually still digitizing his music collection. Vinyls were done long ago but he's still working on his cassettes... But he has an actual tape deck with line level output connected to his PC.
I'll bet.
Reply to
Anssi Saari

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.