Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
082850d
work in progress.
Jun 2, 2016
9cb1d73
update ppc isa: no out in components supported yet.
Jun 3, 2016
833f96b
update static analysis for instruction ‘if bloc’
Jun 7, 2016
2f62ab0
static analysis. Start to detect const…
Jun 7, 2016
21ce8cb
update ambiguous ‘isConst’ parameter for expIdf to ‘shouldNotAssign’
Jun 8, 2016
e97bdc5
update expIdf to remove ‘isConst’ and add ‘shouldNotAssign’ and ‘isDe…
Jun 8, 2016
f6118be
[galgas] Fix syntax for galgas 3.2.6
Sep 14, 2016
97325fa
[static analysis] whip
Sep 14, 2016
54a8078
[static analysis] fix bug: a var if a var is written many times, with…
Sep 14, 2016
a68d352
wip static analysis
Sep 20, 2016
4893744
log: add the ‘harmlessCode’ gutter for debug purpose
Sep 20, 2016
5a93a39
static analysis fix bugs and generate basic analysis for each instruc…
Sep 20, 2016
d622990
static analysis is now exported as an HTML page through templates
Sep 21, 2016
1487da1
update func « harmlessCode ».
Sep 21, 2016
3358204
detect global me write access
Sep 21, 2016
3e25b73
move static detection from ISA to core.
Sep 21, 2016
40e7215
add memChunk into static analysis.
Sep 21, 2016
8320483
move generated dot files into log/dot/
Sep 23, 2016
367c493
static info: detect correctly memory write access (give the mem space).
Oct 7, 2016
4da3696
[staticInfo] detect dependency on memSpaces (read) in register assign…
Oct 7, 2016
6ee3a82
fix bug in static info for mem space read.
Oct 24, 2016
b9c3401
ISA - add methods for instructions to get fields values.
Oct 26, 2016
71a7d0c
build script for Harmless either works with python 2 and 3.
Oct 27, 2016
bb2c771
[build] remove unneeded debug message
Nov 9, 2016
a868533
[static analysis] trace memory address/value in addition to registers.
Nov 15, 2016
25e944a
Bug fix: the getIdf method for expressions did not handle correctly f…
Nov 23, 2016
fcd17b0
[log] update harmlessCode getter to get also the code line
Nov 23, 2016
23d5a22
display ‘field’ keyword in harmlessCode.
Nov 23, 2016
cd3bb75
[gadl format] fix bug when there is an offset to a slice on multiple …
Nov 28, 2016
bb21252
Cortex-M model. Work in progress with syntax (16 bits ISA only)
Nov 28, 2016
c5a288d
ISA syntax: add the ‘function’ keyword to get the string of the curre…
Nov 29, 2016
c5d525c
ISA Syntax. Add the ‘function address’ expression for syntax
Nov 29, 2016
91e3684
Update labels so that it shows the function name and offset, as in ob…
Nov 29, 2016
2b73c6f
[Cortex] armv8m 16bits format+syntax ok.
Dec 6, 2016
202c80e
fix disassembler print error (opcode of instruction for variable-leng…
Mar 8, 2017
85ccee2
[ISA format] fix bug for variable length format ISA (slices)
Mar 8, 2017
176dc1f
[samd21] first 32 bits instructions. test script updated.
Mar 8, 2017
ae62c47
simu: Change disassembler function in ‘core’ to decode a number of in…
Mar 8, 2017
990bba1
[samd21] update tests for 32 bits targets. We will have to check 4G i…
Mar 8, 2017
26b8c01
[Gadl ISA] bug when handling format slices with multiple format sizes…
Mar 21, 2017
9458236
[syntax] possible name conflict in syntax part…
Apr 24, 2017
5517533
[format] update getBinarySet method that did not work for some binary…
Apr 24, 2017
76d725c
[format] remove a bug with binaryset..
May 2, 2017
3ceeb82
[test cortex] update tests to be run in parallel on many cores.
May 2, 2017
12ce6cc
[cortex isa] end of data processing shifted instructions.
May 2, 2017
d4e085f
[cortex isa] end of Data processing (plain binary immediate) (binary+…
May 3, 2017
52a2ed7
[format] add the ‘restrict slice{xx} to \m..’ instruction in the form…
May 6, 2017
185f0f3
[gadl format] add expression as fields in format view
May 10, 2017
feb887e
[cortex] start branch32 instructions
May 10, 2017
98feff0
[cortex] start branch32 instructions
May 10, 2017
4c856cf
[test] exception handling + try to limit processes when an error occurs.
May 10, 2017
bf0744b
[cortex isa] bin+syntax of branch instructions.
May 15, 2017
e00af09
[cortex] hint32 instructions
May 15, 2017
c3428f8
start of coproc instruction. It is not the right approach. Should be …
Sep 14, 2017
5868b9b
add str.b/.h instructions.
Sep 14, 2017
7170541
update assembly test directory for Cortex-M model
Sep 20, 2017
b302676
start behavior test suite for Cortex-M
Sep 20, 2017
4ec1828
behavior test. First generated gdb script that runs on the real target.
Sep 20, 2017
e794106
[cortex behavior test suite]. Works. 3 instructions added
Sep 26, 2017
87d62b3
cortex behavior. More instructions defined (and tested)
Sep 26, 2017
0dc1e1d
[cortex] 16-bits dataProc instructions done and tested.
Sep 27, 2017
6e0778c
cortex: behavior of first instruction with 4-bits register encoding…
Sep 28, 2017
5375721
[cortex-M model] behavior of special data instructions and BX/BLX.
Oct 3, 2017
d426eda
[gadl code reader] remove a memory leak when reading .elf files.
Dec 6, 2017
9b56c13
behavior tests Json doc
Jan 9, 2018
1ddc7d8
start description of load/store, with functional test. Wip
Jan 9, 2018
238bcc1
[behavior test on Cortex] update verbose in script output
Jan 19, 2018
a196d1e
[cortex behavior test] add ‘mem’ section for load/store. Should be te…
Jan 22, 2018
da7fe48
[cortex example] behavior test bug fix.
Jan 22, 2018
97ca007
[cortex example] bug fix in behavior test script (gdb)
Jan 22, 2018
36c897a
[cortex example] behavior model+test of many 16-bits instructions. in…
Jan 31, 2018
d33f718
[cortex] stm/ldm instructions.
Jan 31, 2018
fbbbe93
[cortexM] behavior branchements conditionnels
Feb 6, 2018
42c723c
[cortex behavior test script] memory in init section.
Feb 7, 2018
5fcb9cf
[cortex-M] svc instruction. Test fails.
Feb 15, 2018
53c1ca1
[cortex behavior test] add flash example to test svc
Feb 15, 2018
ff6da49
[cortex example] test.py updated
Feb 16, 2018
c9cf9da
[cortex ISA] end of 16-bits instruction…
Feb 19, 2018
fd2cb98
[gadl] syntax: loop without condition (‘while’)
Mar 12, 2018
1a0afc2
[cortex] add strex instructions, and some tests
Mar 12, 2018
3ebde84
[behavior test script] Add a ‘quick’ mode to test only the first 100 …
Mar 14, 2018
000f6e2
[cortex Model] add ‘exclusive’ instruction (strex, ldrex,…)
Mar 14, 2018
a7bf291
[cortex model] ldmdb instruction test.
Mar 15, 2018
318a4d4
[cortex model] more tests
Mar 19, 2018
fc7cac3
[cortex model] ldrd instruction test.
Mar 20, 2018
c6c1ed6
[cortex model] fix assembly script (link script pb)
Mar 20, 2018
faf78c7
[cortex-M] add single store instruction.
Mar 23, 2018
224f581
[cortex-M] add format/syntax part for ldr (wip)]
Mar 30, 2018
dd73798
[cortex-M] bug fix
Mar 30, 2018
8047ebc
[cortex] instruction ‘load bytes and mem hints’. format and syntax. WiP.
Apr 5, 2018
8972112
[behavior test script] bug fix for python3
Apr 10, 2018
9ac8d42
[Coretx-M behavior script test] bug fix for Python3
Apr 11, 2018
4184687
[Coretx-M behavior script test] bug fix2 for Python3
Apr 11, 2018
5052a6d
[cortex-M] doc of architecture of behaviorTest script
Apr 17, 2018
5312175
[cortex-M] test file for ADC with 3 registres
Apr 23, 2018
d06d61c
[Cortex-M model]. Support for Python3. Some tests should be done agai…
Apr 24, 2018
c421bca
[cortex-M example] gdb output updated for behavior test script (pytho…
Apr 25, 2018
a790a95
[cortexM] behavior test script better debugger integration
May 15, 2018
e585ef2
[cortexM] assembly test link script
May 15, 2018
4546a78
Merge branch 'staticInfo' of https://github.com/mbriday/harmless into…
May 15, 2018
dd9a34b
[CortexM] assembly tests defaults with Python3.
May 15, 2018
72eb36b
[cortexM] Load bytes, mem hints 32 bits instruction decode ok (tested.)
May 15, 2018
15c1877
[cortexM] Load Half word 32 bits instruction decode Ok.
May 15, 2018
6f2466c
[cortexM] load word 32 bits instructions decode, tested.
May 15, 2018
653b504
[cortexM] start description of data Processing (reg).
May 15, 2018
14104f8
bug fix in function exec generation
May 23, 2018
30da1b5
initial commit
Ghyath25 May 25, 2018
1fbfc97
JSON files for 32 bits instructions
Ghyath25 May 25, 2018
1af2b0a
modifié : ../../../../../../buildHarmless.py
Ghyath25 May 28, 2018
837067e
[cortexM] behavior of add.w. Not tested.
Jun 5, 2018
fabe8d5
[cortexM] behavior test => init pb with openocd
Jun 5, 2018
2380e3e
modifié : cortex-armv6-M.isa
Ghyath25 Jun 6, 2018
de970d6
Merge branch 'staticInfo' of https://github.com/mbriday/harmless into…
Ghyath25 Jun 6, 2018
d456208
modifié : test/behavior/json/instructions32bits/bicreg.json
Ghyath25 Jun 14, 2018
bf308d6
modifié : cortex-armv6-M.isa
Ghyath25 Jun 18, 2018
3565cfa
nouveau fichier : .cortex-armv6-M.isa.swo
Ghyath25 Jun 18, 2018
c857186
../../makefile-unix/gadl-debug
Ghyath25 Jun 18, 2018
2e083a9
modifié : ../../.cortex-armv6-M.isa.swo
Ghyath25 Jun 19, 2018
bed44a9
nouveau fichier : movt.json_output.gdb.zip
Ghyath25 Jun 19, 2018
f2d26b8
nouveau fichier : gadl-debug
Ghyath25 Jun 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Build/*
*.tmp
compilationLog.txt
libelf/*
libelf-*/*
.*.swp
galgas
7 changes: 5 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### buildHarmless.py

* faire un dossier `build` dans lequel on met tout (y compris libelf/libpm).
* mettre explicite les dossiers de `build/` et pas `.build/`
* mettre explicite les dossiers de `build/` et pas `.build/` => c'est en cours: pb avec les filewrappers. Voir fichier buildHarmless.py.tmp
* faire un `clean`

### test
Expand All @@ -12,4 +12,7 @@
* faire une doc utilisateur (comment lancer les tests, en rajouter, les pré-requis)

## modèle armv6-M
* faire tourner un modèle vide (constructeur vide, pas d'architecture/pipeline, ...).
* faire tourner un modèle vide (constructeur vide, pas d'architecture/pipeline, ...).

# DEV
=> voir fichier TODO dans les sources galgas.
169 changes: 93 additions & 76 deletions buildHarmless.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,30 @@
# -*- coding: UTF-8 -*-
# vim: set fileencoding=utf-8 :
# This script is used to build harmless tools automagically.
# Common build program should be installed (make/gcc/..).
# Common build tools should be installed (make/gcc/..).

# The script:
# * check for the galgas version, and download the most recent version if necessary
# * generate gadl sources (c++) from the galgas description.
# * build a2cpp/p2a and gadl.

#tested on MacOS X (10.6.8) and Linux Ubuntu (12.04) - 32 bits.
#tested on MacOS X (10.10) and Linux Ubuntu (12.04) - 32 bits.
#This should work either with Python 2.7 and 3.
#please report any error to [email protected]

import urllib2;
from __future__ import print_function
import sys
if sys.version_info[0] == 2 and sys.version_info[1] <= 6:
print("Python version 2.7 minimum required")
sys.exit(1)
if sys.version_info.major < 3: #python2.7 mini required
from urllib2 import URLError,urlopen
from urllib import urlretrieve
else:
from urllib.request import urlopen, urlretrieve
from urllib.error import URLError
import socket
import os, sys, urllib
import os, sys
import subprocess
import re

Expand All @@ -23,14 +34,15 @@ def scriptStep(verbose,num,msg):
line=' step '+str(num)+":"+msg+' '
if len(line) & 1 == 1: #odd value
line+=' '
nbStar=(80-len(line))/2
print '*'*nbStar+line+'*'*nbStar
nbStar=(80-len(line))//2 #integer division
print('*'*nbStar+line+'*'*nbStar)
return num+1

#Hook to print the download process of galgas.
def reporthook(a,b,c):
def reporthook(a,b,c):
# ',' at the end of the line is important!
print "% 3.1f%% of %d bytes\r" % (min(100, float(a * b) / c * 100), c),
print('{val:3.1f}% of {size} bytes\r'.format(val=min(100, float(a * b) / c * 100),size=c),end='\r')
#print "% 3.1f%% of %d bytes\r" % (min(100, float(a * b) / c * 100), c),
sys.stdout.flush()

#code example extracted from:
Expand Down Expand Up @@ -63,13 +75,13 @@ def downloadGalgas(URLGalgas,galgasVersion,forceSrc,scriptWorkingDir):
archiveName = "galgas-x86-linux32.zip"
archiveType = 'zip'
else:
print "The Linux host does not seem to be an x86 or x86_64 processor: "+uname[4]
print("The Linux host does not seem to be an x86 or x86_64 processor: "+uname[4])
archiveName = 'galgas-sources-lf.tar.bz2'
archiveType = 'src'
else:
#unknown host
print "The host does not seem to be either Linux or Mac:"+uname[0]
print "Cannot find a galgas binary that matches the host."
print("The host does not seem to be either Linux or Mac:"+uname[0])
print("Cannot find a galgas binary that matches the host.")
archiveName = 'galgas-sources-lf.tar.bz2'
archiveType = 'src'
#second: Download.
Expand All @@ -78,33 +90,35 @@ def downloadGalgas(URLGalgas,galgasVersion,forceSrc,scriptWorkingDir):
#http://galgas.rts-software.org/download/lastRelease.php -> 2.3.7
#http://galgas.rts-software.org/download/2.3.7/galgas-x86-linux32.zip
URLGalgasArchive = URLGalgas+galgasVersion+'/'+archiveName
print ' -> download last release of the Galgas compiler ('+URLGalgasArchive+')'
urllib.urlretrieve(URLGalgasArchive, scriptWorkingDir+'/'+archiveName, reporthook)
print(' -> download last release of the Galgas compiler ('+URLGalgasArchive+')')
print('and save it in '+scriptWorkingDir+'/'+archiveName)
urlretrieve(URLGalgasArchive, scriptWorkingDir+'/'+archiveName, reporthook)
print #\n
except urllib2.URLError:
print "Error: Unable to get the last revision of galgas. Exit"
except URLError:
print("Error: Unable to get the last revision of galgas. Exit")
sys.exit()
#Third: extract.
print "extract galgas compiler from the downloaded archive"
print("extract galgas compiler from the downloaded archive")
if archiveType == 'dmg':
#mount image file (dmg) using "hdid galgas-tool.dmg"
output = subprocess.Popen(['hdid',scriptWorkingDir+'/'+archiveName], stdout=subprocess.PIPE).communicate()[0]
#print(output)
#one output line should be like this.
#/dev/disk2s2 Apple_HFSX /Volumes/GALGAS-TOOL
for line in output.split('\n'):
for line in output.split(b'\n'):
fields=line.split()
if len(fields) >= 2:
if fields[1] == "Apple_HFSX":
if fields[1] == b'Apple_HFSX':
#found
#copy the executable: call wait until command is complete.
subprocess.call(['cp','-v',fields[2]+'/galgas',scriptWorkingDir])
subprocess.call(['cp','-v',fields[2]+b'/galgas',scriptWorkingDir])
#and umount image disk.
subprocess.call(['umount',fields[2]])
elif archiveType == 'zip': #Linux
popenZip = subprocess.Popen(['unzip','-q',archiveName],cwd=scriptWorkingDir)
popenZip.wait()
elif archiveType == 'src': #source package.
print "Compile galgas from source, assuming an Unix host."
print("Compile galgas from source, assuming an Unix host.")
popenTar = subprocess.Popen(['tar','xjf',archiveName],cwd=scriptWorkingDir) #decompress
popenTar.wait()
subprocess.call(['mv',scriptWorkingDir+'/'+'galgas',scriptWorkingDir+'/'+'galgasSrc']) #rename source directory
Expand All @@ -117,14 +131,14 @@ def downloadGalgas(URLGalgas,galgasVersion,forceSrc,scriptWorkingDir):
#Fifth: Test galgas (in case of downloading a binary target)
# if binary target does not run, try to unpack the source archive.
if archiveType != 'src':
if subprocess.call([scriptWorkingDir+'/galgas','--version']): #galgas run failed.
print "The galgas binary does not seems to work..."
print "retry using the galgas source package, it will take more time.."
subprocess.call(['rm',scriptWorkingDir+'/galgas']) #remove galgas (as it does not run properly)
downloadGalgas(URLGalgas,galgasVersion,True,scriptWorkingDir) #and get a new version from sources.


try:
if subprocess.call([scriptWorkingDir+'/galgas','--version']): #galgas run failed.
print("The galgas binary does not seems to work...")
print("retry using the galgas source package, it will take more time..")
subprocess.call(['rm',scriptWorkingDir+'/galgas']) #remove galgas (as it does not run properly)
downloadGalgas(URLGalgas,galgasVersion,True,scriptWorkingDir) #and get a new version from sources.
except FileNotFoundError:
print("Error during download, the Galgas compiler has not been correctly downloaded.")

def installGalgas(verbose,scriptWorkingDir):
galgasProg = whereis('galgas',scriptWorkingDir)
Expand All @@ -133,51 +147,54 @@ def installGalgas(verbose,scriptWorkingDir):
#first, get the latest galgas version (and check Internet connexion)
galgasVersion = ""
try:
resp = urllib2.urlopen(URLGalgas+'lastRelease.php')
galgasVersion = resp.read(100)
except urllib2.URLError:
resp = urlopen(URLGalgas+'lastRelease.php')
galgasVersion = resp.read(100).decode("utf-8")
except URLError:
galgasSiteOk = False

if galgasProg is None:
#no galgas found -> download.
if not galgasSiteOk:
print "I could not find any version of the galgas compiler,",
print "which is mandatory to build the Harmless compiler. "
print "The galgas web site: "+URLGalgas+" is not reachable."
print "Please check your Internet connection."
print "You can set your proxy configuration using the command"
print "export http_proxy=\"http://proxyIP:proxyPort\""
print "(before calling this script)"
print("I could not find any version of the galgas compiler, "+
"which is mandatory to build the Harmless compiler. ")
print("The galgas web site: "+URLGalgas+" is not reachable.")
print("Please check your Internet connection.")
print("You can set your proxy configuration using the command")
print("export http_proxy=\"http://proxyIP:proxyPort\"")
print("(before calling this script)")
sys.exit()
else:
print "I could not find the galgas compiler in the PATH"
print("I could not find the galgas compiler in the PATH")
downloadGalgas(URLGalgas,galgasVersion,False,scriptWorkingDir)
else: #galgas found, check version.
if galgasSiteOk:
#note: subprocess.check_output only appeared in v2.7 and is not available on MacOS 10.6
output = subprocess.Popen([galgasProg,"--version",'-q'], stdout=subprocess.PIPE).communicate()[0]
m = re.search(r".*\s:\s+(.*), build.*$", output)
m = re.search(b'.*\s:\s+(.*), build.*$', output)
if m != None:
if m.group(1) == galgasVersion:
currentGalgasVersion = m.group(1).decode("utf-8")
if currentGalgasVersion == galgasVersion:
if verbose:
print "galgas version OK ("+galgasVersion+")"
print("galgas version OK ("+galgasVersion+")")
else:
print "The galgas compiler is installed, but the galgas version does not match."
print("The galgas compiler is installed, but the galgas version does not match.")
print("installed: "+currentGalgasVersion)
print("last version "+galgasVersion)
downloadGalgas(URLGalgas,galgasVersion,False,scriptWorkingDir)
else:
print "internal error: I found the galgas compiler, but I cannot find its version."
print "latest version available is: "+galgasVersion
print("internal error: I found the galgas compiler, but I cannot find its version.")
print("latest version available is: "+galgasVersion)
downloadGalgas(URLGalgas,galgasVersion,False,scriptWorkingDir)
else: #no Internet connexion, don't try to update.
if verbose:
print "no Internet connexion. Cannot try to update the Galgas compiler."
print("no Internet connexion. Cannot try to update the Galgas compiler.")
return whereis('galgas',scriptWorkingDir)

def buildFailed(step):
print '*'*80
print "build failed at step", step
print "You may contact [email protected]"
print '*'*80
print('*'*80)
print("build failed at step"+str(step))
print("You may contact [email protected]")
print('*'*80)
sys.exit(step)

if __name__ == '__main__':
Expand All @@ -186,7 +203,7 @@ def buildFailed(step):
scriptWorkingDir = os.path.abspath(pathname)

verbose = True
ok=True
ok=True
step = 1
socket.setdefaulttimeout(5) #not to stop the script for a long time if there is no connection.
#check if galgas is installed
Expand All @@ -195,44 +212,44 @@ def buildFailed(step):
if galgasTool:

step=scriptStep(verbose,step,"extract libpm, required by p2a and a2cpp")
if subprocess.call([galgasTool,'--extract-libpm='+scriptWorkingDir+'/gadl/libpm','-q']):
if subprocess.call([galgasTool,'--extract-libpm='+scriptWorkingDir+'/gadl/libpm','-q']):
buildFailed(step-1)

step=scriptStep(verbose,step,"compile p2a tool")
popenP2A = subprocess.Popen(["make",'-j9'],cwd=scriptWorkingDir+'/p2a')
if popenP2A.wait():
if popenP2A.wait():
buildFailed(step-1)

step=scriptStep(verbose,step,"compile a2cpp tool")
popenA2CPP = subprocess.Popen(["make",'-j9'],cwd=scriptWorkingDir+'/a2cpp')
if popenA2CPP.wait():
if popenA2CPP.wait():
buildFailed(step-1)

step=scriptStep(verbose,step,"compile libelf")
libelfFile = 'libelf-0.8.13'
logPID = open('./compilationLog.txt', 'w')
libelfArchive = libelfFile+'.tar.gz'
popenLibElf = subprocess.Popen(['tar','xzf','gadl/'+libelfFile+'.tar.gz'],cwd=scriptWorkingDir)
if popenLibElf.wait():
if popenLibElf.wait():
buildFailed(step-1)
print "configure "+libelfFile+"..."
print("configure "+libelfFile+"...")
popenLibElf = subprocess.Popen(['./configure','--enable-compat',
'--enable-shared=no','--prefix='+scriptWorkingDir+'/libelf'],stdout=logPID,cwd=scriptWorkingDir+'/'+libelfFile)
if popenLibElf.wait():
if popenLibElf.wait():
buildFailed(step-1)
print "make "+libelfFile+"..."
print("make "+libelfFile+"...")
popenLibElf = subprocess.Popen(['make','CFLAGS=-fPIC','LDFLAGS=-fPIC','-j9'],stdout=logPID,cwd=scriptWorkingDir+'/'+libelfFile)
if popenLibElf.wait():
if popenLibElf.wait():
buildFailed(step-1)
print "install "+libelfFile+" in ./libelf"
print("install "+libelfFile+" in ./libelf")
popenLibElf = subprocess.Popen(['make','install'],stdout=logPID,cwd=scriptWorkingDir+'/'+libelfFile)
if popenLibElf.wait():
if popenLibElf.wait():
buildFailed(step-1)
logPID.close

step=scriptStep(verbose,step,"generate gadl C++ sources using galgas")
popenGalgas = subprocess.Popen([galgasTool,'gadl/gadl.galgasProject','-q'],cwd=scriptWorkingDir)
if popenGalgas.wait():
if popenGalgas.wait():
buildFailed(step-1)

step=scriptStep(verbose,step,"compile gadl tool")
Expand All @@ -246,22 +263,22 @@ def buildFailed(step):
gadlLoc = gadlLoc+"/gadl/makefile-unix"
# popenGADL = subprocess.Popen(["make",'gadl','-f','makefile','-j9'],cwd=gadlLoc)
popenGADL = subprocess.Popen(["./build+release.py",'all', '-1'],cwd=gadlLoc) # -1 means processor count + 1
if popenGADL.wait():
if popenGADL.wait():
buildFailed(step-1)

subprocess.call(['mv',gadlLoc+'/gadl',scriptWorkingDir+'/gadl/gadl'])
print '*'*80
print 'test generated compiler:'
print('*'*80)
print('test generated compiler:')
if not subprocess.call([scriptWorkingDir+'/gadl/gadl','--version']): #test gadl binary.
print '* Gadl, the Harmless compiler is succesfully compiled:'
print '* -> '+scriptWorkingDir+'/gadl/gadl'
print '* You can generate simulators from description examples. For the PowerPC:'
print '* \tcd '+scriptWorkingDir+'/gadl/examples/PPC'
print '* \t../../gadl ./ppc.hadl'
print '* A directory \'powerpc\' is created (from the CPU model name in description).'
print '* Then compile the simulator:'
print '* \tcd powerpc'
print '* \tmake standalone'
print('* Gadl, the Harmless compiler is succesfully compiled:')
print('* -> '+scriptWorkingDir+'/gadl/gadl')
print('* You can generate simulators from description examples. For the PowerPC:')
print('* \tcd '+scriptWorkingDir+'/gadl/examples/PPC')
print('* \t../../gadl ./ppc.hadl')
print('* A directory \'powerpc\' is created (from the CPU model name in description).')
print('* Then compile the simulator:')
print('* \tcd powerpc')
print('* \tmake standalone')
else:
print '* There was a problem and the gadl compilation failed'
print '*'*80
print('* There was a problem and the gadl compilation failed')
print('*'*80)
4 changes: 2 additions & 2 deletions gadl/doc/en/installation.tex
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ \subsection{System Observation}

\paragraph{\texttt{unsigned int const getNBCycles()}} give the number of cycles since the beginning of the simulation. This is not used in the ISS mode (Instruction Set Simulation).
\paragraph{\texttt{unsigned int const getNBInstructions()}} give the number of instruction executed since the beginning of the simulation.
\paragraph{\texttt{string disassemble(const unsigned int ipStart, const int nbBytes, bool verbose)}} disassemble code from address
\texttt{ipStart}, for \texttt{nbBytes} bytes. If \texttt{verbose} is \texttt{true}, The decoding address and the instruction binary code are displayed.
\paragraph{\texttt{string disassemble(const unsigned int ipStart, const int nbInst, bool verbose)}} disassemble code from address
\texttt{ipStart}, for \texttt{nbInst} instructions. If \texttt{verbose} is \texttt{true}, The decoding address and the instruction binary code are displayed.

\subsection{Execution}
\paragraph{\texttt{void reset()}}
Expand Down
2 changes: 1 addition & 1 deletion gadl/doc/fr/installation.tex
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ \subsection{Observation du système}

\paragraph{\texttt{unsigned int const getNBCycles()}} Retourne le nombre de cycles depuis le début de la simulation. Cette variable n'est pas actualisée dans le cas de l'utilisation en mode ISS (simulation de jeu d'instruction).
\paragraph{\texttt{unsigned int const getNBInstructions()}} Retourne le nombre d'instructions utilisées depuis le début de la simulation.
\paragraph{\texttt{string disassemble(const unsigned int ipStart, const int nbBytes, bool verbose)}} Permet le désassemblage du code à partir de l'adresse \texttt{ipStart}, pour \texttt{nbBytes}. Si verbose est à \texttt{true}, l'adresse de décodage ainsi que le code binaire de l'instruction sont également affichés.
\paragraph{\texttt{string disassemble(const unsigned int ipStart, const int nbInst, bool verbose)}} Permet le désassemblage du code à partir de l'adresse \texttt{ipStart}, pour \texttt{nbInst} instructions. Si verbose est à \texttt{true}, l'adresse de décodage ainsi que le code binaire de l'instruction sont également affichés.

\subsection{Execution}
\paragraph{\texttt{void reset()}}
Expand Down
Loading