nedoPC.org

Community of electronics hobbyists established in 2002

...
Atom Feed | View unanswered posts | View active topics It is currently 27 May 2017 11:37



Reply to topic  [ 273 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18, 19  Next
[Ternary] Tunguska the ternary emulator 
Author Message
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
eudoxie wrote:
Nice :-)


1st run on G4-Cube with Debian 5.0:

Code:
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o tryte.o tryte.cc
tryte.h: In constructor tryte::tryte():
tryte.h:41: warning: tryte::cache will be initialized after
tryte.h:38: warning:   tryte::change_hook* tryte::hook
tryte.cc:30: warning:   when initialized here
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o machine.o machine.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o tunguska.o tunguska.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o display.o display.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o keyboard.o keyboard.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o interrupt.o interrupt.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o disk.o disk.cc
disk.cc: In member function virtual void disk::load(const char*):
disk.cc:49: error: strdup was not declared in this scope
make: *** [disk.o] Ошибка 1


This is for gcc (Debian 4.3.2-1.1) 4.3.2


21 Aug 2009 22:15
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
after minor fixes in tryte.cc (order of initialization in constructor) and machine.h (#include <string.h> for strdup):

Code:
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o trit.o trit.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o tryte.o tryte.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o machine.o machine.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o tunguska.o tunguska.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o display.o display.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o keyboard.o keyboard.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o interrupt.o interrupt.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o disk.o disk.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o agdp.o agdp.cc
g++ `pkg-config sdl --cflags` -O3 -funroll-loops -Wall    -c -o memory.o memory.cc
g++ trit.o tryte.o machine.o tunguska.o interrupt.o display.o keyboard.o disk.o agdp.o memory.o -o tunguska `pkg-config sdl --libs` -lfl -lz
/usr/bin/ld: cannot find -lfl
collect2: ld returned 1 exit status
make: *** [tunguska] Ошибка 1


21 Aug 2009 22:27
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
after aptitude install flex tunguska and tg_assembler were compiled successfully

after installing packages for GTK development:

Code:
make -C gtkui all
make[1]: Entering directory `/home/shaos/Sources/Tunguska/tunguska_sources/gtkui'
g++ `pkg-config gtk+-2.0 gtksourceview-2.0 gio-2.0 --cflags` -I"../" -O3 -funroll-loops -Wall -DUSE_GTKSOURCEVIEW -ggdb   -c -o tunguska_gtk.o tunguska_gtk.cc
g++ `pkg-config gtk+-2.0 gtksourceview-2.0 gio-2.0 --cflags` -I"../" -O3 -funroll-loops -Wall -DUSE_GTKSOURCEVIEW -ggdb   -c -o processor_monitor.o processor_monitor.cc
g++ `pkg-config gtk+-2.0 gtksourceview-2.0 gio-2.0 --cflags` -I"../" -O3 -funroll-loops -Wall -DUSE_GTKSOURCEVIEW -ggdb   -c -o variable_tracker.o variable_tracker.cc
variable_tracker.cc: In function GtkWidget* build_tracker():
variable_tracker.cc:172: warning: deprecated conversion from string constant to char*
variable_tracker.cc:173: warning: deprecated conversion from string constant to char*
variable_tracker.cc:174: warning: deprecated conversion from string constant to char*
variable_tracker.cc:175: warning: deprecated conversion from string constant to char*
g++ `pkg-config gtk+-2.0 gtksourceview-2.0 gio-2.0 --cflags` -I"../" -O3 -funroll-loops -Wall -DUSE_GTKSOURCEVIEW -ggdb   -c -o code_editor.o code_editor.cc
code_editor.cc: In function GtkWidget* code_editor_new_from_file(const char*):
code_editor.cc:112: warning: deprecated conversion from string constant to char*
code_editor.cc: In function void initiate_language_manager():
code_editor.cc:147: warning: deprecated conversion from string constant to gchar*
code_editor.cc: At global scope:
code_editor.cc:14: warning: code_editor_signals defined but not used
g++ `pkg-config gtk+-2.0 gtksourceview-2.0 gio-2.0 --cflags` -I"../" -O3 -funroll-loops -Wall -DUSE_GTKSOURCEVIEW -ggdb   -c -o inspector.o inspector.cc
g++ `pkg-config gtk+-2.0 gtksourceview-2.0 gio-2.0 --cflags` -I"../" -O3 -funroll-loops -Wall -DUSE_GTKSOURCEVIEW -ggdb   -c -o file_manager.o file_manager.cc
file_manager.cc: In function GtkWidget* create_file_manager():
file_manager.cc:190: warning: deprecated conversion from string constant to gchar*
file_manager.cc:191: warning: deprecated conversion from string constant to gchar*
g++ `pkg-config gtk+-2.0 gtksourceview-2.0 gio-2.0 --cflags` -I"../" -O3 -funroll-loops -Wall -DUSE_GTKSOURCEVIEW -ggdb   -c -o tunguska_wrapper.o tunguska_wrapper.cc
tunguska_wrapper.cc: In function gboolean tunguska_keypress(GtkWidget*, GdkEventKey*, void*):
tunguska_wrapper.cc:168: warning: deprecated conversion from string constant to char*
tunguska_wrapper.cc: In function void init_gcs():
tunguska_wrapper.cc:243: warning: unused variable screen_cm
g++ tunguska_gtk.o processor_monitor.o variable_tracker.o code_editor.o inspector.o  file_manager.o tunguska_wrapper.o ../machine.o ../trit.o ../tryte.o ../disk.o ../memory.o ../interrupt.o ../agdp.o -o tunguska_gtk `pkg-config gtk+-2.0 gtksourceview-2.0 gio-2.0 --libs` -lfl -lz -ggdb


P.S. Also I fixed Makefile to avoid constant recompilation of lex.yy.o and parser.tab.o


21 Aug 2009 22:54
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
tunguska_3cc also requires #include <string.h>

Code:
bison -d parser.ypp
flex -+ scanner.l
g++ -Wall -g    -c -o variable.o variable.cc
In file included from variable.h:18,
                 from variable.cc:18:
type.h: In member function virtual bool t_struct::operator==(const type&) const:
type.h:179: error: strcmp was not declared in this scope
type.h: In member function virtual const t_struct::field* t_struct::get_field(const char*) const:
type.h:200: error: strcmp was not declared in this scope
In file included from variable.cc:22:
compiler.h: In member function void compiler::set_effective_location(const char*, int):
compiler.h:96: error: strdup was not declared in this scope
make: *** [variable.o] Ошибка 1


fixed type.h and Makefile (for lex and parser rules)

P.S. Everything is working now on my G4 Cube (Initial benchmark: 177.722 thousand operations per second), but tg_assembler produces different file than little-endian machine and I can fix it (to produce little-endian output file even on big-endian machines and to parse it as little-endian in Tunguska)


22 Aug 2009 01:08
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
Shaos wrote:
... tg_assembler produces different file than little-endian machine and I can fix it (to produce little-endian output file even on big-endian machines and to parse it as little-endian in Tunguska)


memory.cc is fixed and now tg_assembler always produces little-endian output even on big-endian machines and tunguska on big-endian successfully reads input files created on little-endian machines.


22 Aug 2009 18:03
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
So it's time to release 0.5.1? ;)


25 Aug 2009 21:34
Profile WWW
Maniac

Joined: 17 Sep 2012 16:36
Posts: 277
Location: 81.170.128.52
Reply with quote
I've got a few small things to fix, but otherwise, sure. It's got enough fixes to merit a release. I'll try to have a test package ready this weekend.


25 Aug 2009 21:44
Profile
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
eudoxie wrote:
I've got a few small things to fix, but otherwise, sure. It's got enough fixes to merit a release. I'll try to have a test package ready this weekend.


OK, and I'll check current code under MacOS X 10.4 on my PowerBook G4


25 Aug 2009 22:29
Profile WWW
Maniac

Joined: 17 Sep 2012 16:36
Posts: 277
Location: 81.170.128.52
Reply with quote
Fixed the embarrassing error in symbols.bmp.

Compiles and runs fine on gentoo x86_64 now with your fixes :-)


28 Aug 2009 21:52
Profile
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
eudoxie wrote:
Fixed the embarrassing error in symbols.bmp.

Compiles and runs fine on gentoo x86_64 now with your fixes :-)


That's great! :)
I do not have 64-bit Linux yet...


28 Aug 2009 22:04
Profile WWW
Maniac

Joined: 17 Sep 2012 16:36
Posts: 277
Location: 81.170.128.52
Reply with quote
I've been thinking, it wouldn't be that much work to have AGDP make use of gcc's OpenMP support to allow parallelization of block transfer operations. They're pragma instructions, so they're fully backwards compatible with non-OpenMP ready compilers, and should seriously reduce the speed the block transfer operations take on multicore CPUs.

Preliminary testing shows that OpenMP-enabled for loops boosts the benchmark on the assembly memory image from ~1500 kOP/s to ~1600 kOP/s on my dual core CPU. Which is a really cheap speed boost, seeing as how the code is only modified at half a dozen places to make it work.


29 Aug 2009 14:45
Profile
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
May be to fully utilize 2-core machine the better strategy is using 2 threads: 1st for graphics and 2nd for calculation itself?


30 Aug 2009 00:25
Profile WWW
Maniac

Joined: 17 Sep 2012 16:36
Posts: 277
Location: 81.170.128.52
Reply with quote
That was easier to do before when memory registers weren't asynchronous like they are now, since SDL isn't thread safe making it necessary to do both input and output in the same thread.

A better approach to reduce the graphics overhead is to add some sort minimum redraw interval. Right now, the code often calls updates of the screen way too often (making, worst case scenario, 30% of the CPU time being spent doing nothing but updating the screen).


30 Aug 2009 13:31
Profile
Maniac

Joined: 17 Sep 2012 16:36
Posts: 277
Location: 81.170.128.52
Reply with quote
Actually, I tested that approach, and the initial results aren't looking promising. But I think I have a few ideas on ways it might be made to work.


30 Aug 2009 13:44
Profile
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15340
Location: New York
Reply with quote
Shaos wrote:

OK, and I'll check current code under MacOS X 10.4 on my PowerBook G4

I checked - bad news :(
MacOS X 10.4 has older bison version 1.28 that doesn't create cpp/hpp, instead it creates c/h files and I can't compile it even after renaming...


05 Sep 2009 00:41
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 273 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18, 19  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.