cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
15,380 Views
Registered: ‎02-26-2009

Is it really true, that there's no picoblaze assembler for linux

HiIs it really true, that there's no picoblaze compiler for linux?

This seems really a pity.

 

Of course it is possible to use dosbox or something similiar, but

- at least with my default dosbox setup  dosbox is very slow (10x - 100x)

- having a makefile based setup is a little more complicated and getting quite clumsy.

 

 

Wouldn't it be possible to:

- either provide a Linux executable of the picoblaze assembler ( KCPSM3.EXE ) to the picoblaze release

- or to publish the sources of the assembler, such, that somebody of the Liux community could do the porting

- or to add at least some more info to the pacoblze zip file, like for example

      - infos and perhaps support shell scripts, which could work with

        dosbox / wine / dosemu or whatever is the most efficient solution under Linux?

 

Meanwhile I will start googling to find out how to make dosbox at least a little faster and how to automate dosbox such, 

that it can be part of a makefile based build process

 

 

 

0 Kudos
10 Replies
Highlighted
Adventurer
Adventurer
15,368 Views
Registered: ‎02-26-2009

Re: Is it really true, that there's no picoblaze assembler for linux

As promised:

Some infos about how to use dosbox for running KCPSM3.EXE (until there's a better more efficient solution)

 

 Please feel free to add my comments to the KCPSM3.zip file into the Assembler directory 

 

Running KCPSM3.EXE under Linux (with dobox)

------------------------------------------------------------------

 1.) install dosbox on your linux system (for Ubuntu this can be done with "sudo apt-get install dosbox" )

2.) create a new directory (e.g. ~/picoasm ) and cd into it

3.) copy KCPSM3.EXE and the RAM_form.* files into the current working directory

4.) copy the PSM file, that you want to assemble into the same directory

5.) create a file with the name dosbox.config in the current directory with following contents

######### This is the first line of dosbox.config

[cpu]
cycles=max

 

### commands in the section will be executed automatically at start up

### the following lines assume, that the assembly source file is called

### PICO.PSM

[autoexec]
mount d .
d:

KCPSM3 PICO.PSM > ASM.LOG

# the command exit automatically finishes dosbox and returns control to the calling

# shell script / make file

exit

########## This is the last line of dosbox.config

6.) In order to compile your program just type

dosbox -conf dosbox.config

Dosbox will automatically finish after the compilation.

you can look at ASM.LOG in order to find out, whether assembling the source code was successful.

 

 

 Without the lines

[cpu]

cycles=max 

dosbox was running about 4 times slower on my PC

 

Following lines can also be aded to dosbox.conf

# The lines don't really speed up, but get rid of some potential warnings

### We don't need sound emulation for compiling picoblaze code

[midi]
mpu401=none
device=none
[sblaster]
sbtype=none
[gus]
gus=false

 

 

Please note, that my rather small picoblaze code needs still about 17 seconds with this setup compared to a few seconds under windows XP

on the same (dual boot) host.

 

 

 

 

0 Kudos
Highlighted
Visitor
Visitor
15,349 Views
Registered: ‎03-12-2009

Re: Is it really true, that there's no picoblaze assembler for linux

I use wine (http://www.winehq.org/) to run kcpsm3.exe.  It seems about the same speed as running under XP.

0 Kudos
Highlighted
Adventurer
Adventurer
15,340 Views
Registered: ‎02-26-2009

Re: Is it really true, that there's no picoblaze assembler for linux

Do you hav any examples / configs / tips?

 

WIne fails for me under Ubuntu Hardy with a kernel:  2.6.24-23-386

$ wine KCPSM3.EXE PICO.PSM
err:dosmem:DOSMEM_MapDosLayout Need full access to the first megabyte for DOS mode

 

I found http://wiki.winehq.org/PreloaderPageZeroProblem

and tried to call first 

sudo sysctl -w vm.mmap_min_addr=0 

and only then wine. Now the application freezes(consumes cpu) until I press CTL-C

$ wine KCPSM3.EXE PICO
fixme:int:DOSVM_Int10Handler Get Font Information - Not Supported
fixme:int:DOSVM_Int10Handler Select Active Display Page (0) - Not Supported

DOS memory-arena error

 

I'm stuck there

Having a decent speed for compiling picoblaze programs would be nice.

 

I also found the pacoblaze assembler (implemented in Java), but it has slightly different syntax and quite bad

error reporting.

 

So for the time being I'm still stuck with dosbox and 17 seconds execution time

 

 

 

 

0 Kudos
Highlighted
Visitor
Visitor
15,319 Views
Registered: ‎03-12-2009

Re: Is it really true, that there's no picoblaze assembler for linux

Hmmm.. I haven't seen those error messages. I'm currently using gentoo with kernel 2.6.27.

I'm using wine 1.1.13,  which I compile and install from source code without doing anything special.

 

Looks like PreloaderPageZeroProblem affects Ubuntu.  Have you tried wine on another distro?

 

Another idea is to run DOS/Windows (or another distro) in a vmware (vmplayer) virtual machine.

Kinda overkill just to run an assembler  :)

 

Is pacoblaze faster than using dosbox?  Any java stuff that I've tried has been too slow for me.

 

0 Kudos
Highlighted
Adventurer
Adventurer
15,309 Views
Registered: ‎02-26-2009

Re: Is it really true, that there's no picoblaze assembler for linux

I don't have any other distro, only Ubuntu. :-(

 

Yes, a virtual host sounds like a little bit of overkill. but as soom as the VM is started it should be faster than dosbox.

 

For your info: The pacoblaze assembler needs less than a second

 

dosbox and  KCPSM3.EXE  needs between 15 and 17 seconds for the same file.

 

What I don't like about the pacoblaze assembler is it's non-verobosity about the reason for error conditions.

(mostly not even mentioning the line number)

You loose a lot of time identifying the errors in the source code.

 

KCPSM3.EXE compiled for linux or provided as source with a make file would be more efficient.

 

I think also about writing a small assembler in perl. I just have to estimate the effort first and then I'll decide if I go for it.
0 Kudos
Highlighted
Visitor
Visitor
15,307 Views
Registered: ‎03-12-2009

Re: Is it really true, that there's no picoblaze assembler for linux

Having the source code for kcpsm3.exe available would be very useful for us Linux users.  Based on the comments in this forum, I don't think that will happen.

 

The source code for an older picoblaze assembler is available in xapp387.zip.  I'm not sure if it's compatible with picoblaze 3.

 

If you write an assembler in perl and decide to share it, please post a message in this forum.

 

It would be nice to get away from the quirks in kcpsm3.exe: DOS 16-bit .exe, 8.3 filenames, and uppercase filenames.

0 Kudos
Highlighted
Visitor
Visitor
15,288 Views
Registered: ‎10-01-2007

Re: Is it really true, that there's no picoblaze assembler for linux

You can obtain a picoblaze open-source assembler called picoasm from Mark Six' homepage:

 

http://www.xs4all.nl/~marksix/

 

I'm using that one for quite a while now and it works properly. It spills VHDL and Verilog code, with little modifications you can make picoasm to generate also the .mem files.

 

In my designs, I use up to 256 picoblaze cores. Assembling all the files with DosBox and KCPSM3.EXE takes too long. I had similar problems with running KCPSM3.EXE under wine.

 

I hope it helps!

 

Heiner

0 Kudos
Adventurer
Adventurer
15,276 Views
Registered: ‎02-26-2009

Re: Is it really true, that there's no picoblaze assembler for linux

 Thanks a lot H.

 

This is probably vey helpful.

I downloaded and compiled it already.

I still have to look how at the effort to modify it for mem file generation.

However I guess it will be less work and more consistant than writing a small perlasm from scratch.

 

As soon as I have results I'll either submit the modified assembler or a small perlasm

 

 

Tags (3)
0 Kudos
Highlighted
Historian
Historian
15,272 Views
Registered: ‎02-25-2008

Re: Is it really true, that there's no picoblaze assembler for linux


tvdevnull wrote:

 

It would be nice to get away from the quirks in kcpsm3.exe: DOS 16-bit .exe, 8.3 filenames, and uppercase filenames.


Another SIGNIFICANT annoyance:

 

Hardcoded names and locations for  the template files.

 

I use the pBlaze IDE from Mediatronix, and it's significantly better than the Xilinx tools. This doesn't help the Linux folks, though.

 

-a

----------------------------Yes, I do this for a living.
0 Kudos
Highlighted
Visitor
Visitor
4,760 Views
Registered: ‎10-01-2007

Re: Is it really true, that there's no picoblaze assembler for linux

There is not much to do for extending picoasmt to generate mem-files. You can apply the following patch on 'cassembler.cpp'. This makes picoasm to output the mem-file content on stdout.

 

+++++++++++++ snip++++++++++++++++++++++++++++

*** ./cassembler.cpp    2007-02-15 20:17:16.000000000 +0100
--- ./cassembler.cpp    2007-02-15 20:17:16.000000000 +0100
***************
*** 483,488 ****
--- 483,489 ----


        m_code->setInstruction( address, code, line ) ;
+       printf("%05x\n", code);

        return TRUE ;
  }

+++++++++++++ snip++++++++++++++++++++++++++++ 

0 Kudos