1. 24 Sep, 2005 1 commit
    • Benoit Perrot's avatar
      2005-09-24 Benoît Perrot <benoit@lrde.epita.fr> · 902282e4
      Benoit Perrot authored
      	Introduce system libraries.
      
      	* src/vm/cpu.hh, src/vm/cpu.cc:
      	Export mmu and cp0. Move syscalls' implementation to...
      	* src/vm/system_library.hh, src/vm/system_library.cc,
      	* src/vm/spim_system_library.hh, src/vm/spim_system_library.hxx,
      	* src/vm/spim_system_library.cc:
      	These new files.
      	* src/vm/cp0.hh: Export fatal_exception flag.
      	* src/vm/Makefile.am: Update accordingly.
      	* src/vm/virtual_machine.hh, src/vm/virtual_machine.cc:
      	Propagate system library to cpu.
      	* src/vm-tasks.cc: 
      	Give a default system library to virtual machine.
      
      902282e4
  2. 17 Sep, 2005 2 commits
  3. 03 Sep, 2005 2 commits
    • Benoit Perrot's avatar
      2005-09-03 Benoît Perrot <benoit@lrde.epita.fr> · c87d6b9a
      Benoit Perrot authored
      	Detect several definitions of the same label in a section.
      
      	* src/inst/section.hh (register_label):
      	Return false when label is already known in the section, true
      	otherwise. Move implementation to...
      	* src/inst/section.cc, src/inst/Makefile.am:
      	This new file.
      	* src/inst/data_section.hh, src/inst/data_section.cc,
      	* src/inst/text_section.hh, src/inst/text_section.cc (define_label):
      	Propagate status of register_label.
      	* src/inst/program_builder.hh.gen.py:
      	Generate an error when a label is defined more than once.
      	* tests/solve/data-label-already-defined.s,
      	* tests/solve/text-label-already-defined.s,
      	* tests/solve/Makefile.am:
      	Test it.
      
      c87d6b9a
    • Benoit Perrot's avatar
      2005-09-03 Benoît Perrot <benoit@lrde.epita.fr> · cca2f866
      Benoit Perrot authored
      	* src/misc/unique_string.hh, src/misc/unique_string.cc: 
      	Introduce a constructor from a const char*. Factor string
      	insertion in pool.
      	Suggested by Akim Demaille: Use a set of strings instead of a set
      	of pointers as internal pool. Compose an iterator instead of a
      	pointer.
      	* src/parse/asm-scan.ll.gen.py: 
      	Suggested by Akim Demaille: Don't be affraid to side-affect
      	yytext.
      
      cca2f866
  4. 01 Sep, 2005 2 commits
    • Benoit Perrot's avatar
      2005-09-01 Benoît Perrot <benoit@lrde.epita.fr> · 7e46b563
      Benoit Perrot authored
      	Shame on me.
      
      	* src/misc/unique_string.hh: Fix error: static member function cannot 
      	have const qualifier.
      
      7e46b563
    • Benoit Perrot's avatar
      2005-09-01 Benoît Perrot <benoit@lrde.epita.fr> · 082b5c71
      Benoit Perrot authored
      	Simplify unique_string construction.
      
      	* src/misc/unique_string.hh, src/misc/unique_string.cc (create):
      	Remove. Move its implementation to unique_string's constructor,
      	hence make unique_string aggregate a pointer-to-string instead of a
      	reference.
      	* src/misc/test-unique_string.cc, src/vm/virtual_machine.cc, 
      	* src/shell/shell.cc, src/parse/asm-parse.yy.gen.py,
      	* src/parse/asm-scan.ll.gen.py, src/inst/label_exp.hh,
      	* src/inst/section.hh, src/inst/label.hh:
      	Adjust.
      
      082b5c71
  5. 07 Aug, 2005 2 commits
  6. 31 Jul, 2005 2 commits
    • Benoit Perrot's avatar
      2005-07-31 Benoît Perrot <benoit@nostromo.lrde.epita.fr> · e7ae3852
      Benoit Perrot authored
      	Move generators to source directories.
      
      	* dev/parse-asm-parse-gen.py, dev/parse-asm-scan-gen.py,
      	* dev/inst-solver-gen.py, dev/inst-nodes-gen.py,
      	* dev/inst-builder-gen.py, dev/inst-nodes-mk-gen.py,
      	* dev/doc-inst-set-gen.py:
      	Move to...
      	* src/parse/asm-parse.yy.gen.py, src/parse/asm-scan.ll.gen.py,
      	* src/inst/program_solver.gen.py, src/inst/nodes.gen.py,
      	* src/inst/program_builder.hh.gen.py, src/inst/nodes.mk.gen.py,
      	* doc/inst-set.texi.gen.py:
      	These files (respectively).
      	* src/parse/Makefile.am, src/inst/Makefile.am, doc/Makefile.am,
      	* Makefile.am:
      	Update accordingly.
      	
      e7ae3852
    • Benoit Perrot's avatar
      2005-07-31 Benoît Perrot <benoit@nostromo.lrde.epita.fr> · 50db7c36
      Benoit Perrot authored
      	* configure.ac: Bump to 0.8a
      	* NEWS: Fix release date.
      
      50db7c36
  7. 11 Jul, 2005 1 commit
  8. 03 Jul, 2005 1 commit
  9. 21 Apr, 2005 1 commit
    • Benoit Perrot's avatar
      2005-04-21 Benoît Perrot <benoit@lrde.epita.fr> · 15962a44
      Benoit Perrot authored
      	* dec/parse-asm-scan-gen.py: Explicitely dispatch on signed
      	integer when reading one from a string, by checking its first
      	character (g++-3.4 considers converting "-1" into an "(unsigned&) i"
      	as an error, whereas g++-3.3 did not).
      
      15962a44
  10. 15 Apr, 2005 1 commit
  11. 02 Apr, 2005 3 commits
    • Benoit Perrot's avatar
      2005-04-02 Benoît Perrot <benoit@lrde.epita.fr> · dddbcfb9
      Benoit Perrot authored
      	Introduce `lockable' facility.
      
      	* src/misc/lockable.hh: New file.
      	* src/misc/Makefile.am: Distribute it.
      	* src/inst/text_label.hh, src/inst/exp.hh, src/inst/label.hh,
      	* src/inst/int_exp.hh, src/inst/int_exp.cc:
      	Use lockable.
      	* dev/inst-solver-gen.py: Update accordingly.
      
      dddbcfb9
    • Benoit Perrot's avatar
      2005-04-02 Benoît Perrot <benoit@lrde.epita.fr> · 956e2a0e
      Benoit Perrot authored
      	Split `exp' files.
      
      	* src/inst/exp.hh, src/inst/exp.cc:
      	Split into...
      	* src/inst/label_exp.hh, src/inst/label_exp.cc,
      	* src/inst/op_exp.hh, src/inst/op_exp.cc,
      	* src/inst/int_exp.hh, src/inst/exp.hh:
      	These files.
      	* src/inst/Makefile.am:	Distribute them.
      	* src/vm/cpu.cc, dev/inst-builder-gen.py, dev/inst-solver-gen.py:
      	Update accordingly.
      	
      956e2a0e
    • Benoit Perrot's avatar
      2005-04-02 Benoît Perrot <benoit@lrde.epita.fr> · 9c517382
      Benoit Perrot authored
      	Fix distcheck broken since 2005-03-08's patch.
      
      	* src/vm/Makefile.am: Do not distribute `table.hh' from here, but...
      	* src/misc/Makefile.am: From here.
      
      9c517382
  12. 17 Mar, 2005 1 commit
    • Benoit Perrot's avatar
      2005-03-17 Benoît Perrot <benoit@lrde.epita.fr> · 855cddf8
      Benoit Perrot authored
      	Introduce command identifier completion in shell.
      	
      	* src/shell/shell.hh, src/shell-tasks.cc:
      	Make Shell a singleton.
      	* src/shell/shell.cc: Use readline's custom completers system 
      	to complete command identifiers.
      	
      855cddf8
  13. 08 Mar, 2005 3 commits
    • Benoit Perrot's avatar
      2005-03-08 Benoît Perrot <benoit@lrde.epita.fr> · 5298fb04
      Benoit Perrot authored
      	* src/vm/table.hh: Move to...
      	* src/misc/table.hh: This file.
      	* src/vm/cpu.hh: Update accordingly.
      
      5298fb04
    • Benoit Perrot's avatar
      2005-03-08 Benoît Perrot <benoit@lrde.epita.fr> · d0a692ef
      Benoit Perrot authored
      	Prefer explicit function calls to constructor optional arguments
      	to set non-mandatory attributes (e.g. trace flags).
      
      	* src/vm/cpu.hh, src/vm/cpu.cc, src/vm/virtual_machine.hh,
      	* dev/inst-builder-gen.py (Cpu, VirtualMachine, ProgramBuilder): 
      	Remove uncomprehensible boolean arguments from constructor, add
      	corresponding switches.
      	* src/vm-tasks.cc, src/shell/shell.cc, src/parse/libparse.cc:
      	Update accordingly.
      
      d0a692ef
    • Benoit Perrot's avatar
      2005-03-08 Benoît Perrot <benoit@lrde.epita.fr> · 4f697717
      Benoit Perrot authored
      	Remove redundant accessors from virtual machine.
      	
      	* src/vm/virtual_machine.hh (get_cpu_register, get_cpu_pc):
      	Remove.
      	* src/shell/shell.hh: Use VirtualMachine::get_cpu() instead.
      
      4f697717
  14. 06 Mar, 2005 3 commits
    • Benoit Perrot's avatar
      2005-03-06 Benoît Perrot <benoit@lrde.epita.fr> · 2c970ea6
      Benoit Perrot authored
      	Display the number of executed R,I and J-type instructions on
      	profile.
      
      	* src/vm/cpu.hh, src/vm/cpu.cc: Add an array of counters and
      	update them for each executed instruction.
      	* src/vm/virtual_machine.hh: Add accessor to CPU.
      	* src/vm-tasks.cc: Print the counters on profile.
      
      2c970ea6
    • Benoit Perrot's avatar
      2005-03-06 Benoît Perrot <benoit@lrde.epita.fr> · c50f9289
      Benoit Perrot authored
      	Specify instruction format type to distinguish register, immediate
      	and jump instructions.
      
      	* src/inst/inst.hh: Add a format attribute.
      	* dev/nolimips.xml, dev/nolimips.py, dev/inst-nodes-gen.py: 
      	Fill it.
      	
      c50f9289
    • Benoit Perrot's avatar
      2005-03-06 Benoît Perrot <benoit@lrde.epita.fr> · 5bc23e86
      Benoit Perrot authored
      	Provide `--profile' option.
      
      	* src/vm/virtual_machine.hh: Add accessor to control coprocessor.
      	* src/vm-tasks.hh, src/vm-tasks.cc: Declare and define the
      	`profile' task. For the moment, simply print on stderr the number
      	of executed cyles at the end of the program's execution.
      
      5bc23e86
  15. 15 Feb, 2005 1 commit
  16. 03 Feb, 2005 3 commits
    • Benoit Perrot's avatar
      2005-02-03 Benoît Perrot <benoit@lrde.epita.fr> · cf2790d6
      Benoit Perrot authored
      	* src/inst/data_section.hh, src/inst/data_section.cc,
      	* src/inst/text_section.hh, src/inst/text_section.cc:
      	Maintain a list of encountered (not sorted) labels. Use it to 
      	print the content of the sections.
      	* src/inst/section.hh: Remove deprecated attributes.
      	* src/inst/text_label.hh (get_iterator): Constify return value.
      
      cf2790d6
    • Benoit Perrot's avatar
      2005-02-03 Benoît Perrot <benoit@lrde.epita.fr> · 72081162
      Benoit Perrot authored
      	* src/inst/section.hh: Store the labels in a set. Use Labels to get 
      	the offset.
      	* src/inst/label.hh (deref_ptr_less): Declare and define a label 
      	pointer comparator.
      
      72081162
    • Benoit Perrot's avatar
      2005-02-03 Benoît Perrot <benoit@lrde.epita.fr> · cbd0b70b
      Benoit Perrot authored
      	Store an iterator in TextLabels.
      
      	* src/inst/text_label.hh: Do it.
      	* src/inst/text_section.hh (define_label): Move its 
      	implementation into...
      	* src/inst/text_section.cc (define_label): This file, to solve 
      	inclusion cycle.
      
      cbd0b70b
  17. 01 Feb, 2005 3 commits
    • Benoit Perrot's avatar
      2005-01-30 Benoît Perrot <benoit@lrde.epita.fr> · de204fcf
      Benoit Perrot authored
      	Prepare iterator in text_label storage.
      	
      	* src/inst/text_section.hh: Maintain an iterator on the very last 
      	instruction slot.
      
      de204fcf
    • Benoit Perrot's avatar
      2005-01-30 Benoît Perrot <benoit@lrde.epita.fr> · e467fceb
      Benoit Perrot authored
      	Store the instructions in a list to prepare future random insertions.
      	
      	* src/inst/text_section.hh: Store the instructions in a list 
      	instead of a vector to ease random insertions.
      	* src/inst/text_section.cc (~TextSection, print): Use TextSection's 
      	typedefs and dedicated begin and end to iterate through the  
      	instruction container.
      	* dev/inst-solver-gen.py: Use operator!= instead of operator< to 
      	stop the iteration.
      	
      e467fceb
    • Benoit Perrot's avatar
      2005-01-29 Benoît Perrot <benoit@lrde.epita.fr> · 58ab9449
      Benoit Perrot authored
      	Make Label compose its associated offset.
      
      	* src/inst/label.hh: Protect default constructor. Compose its
      	associated offset. Add a constructor that waits for it.
      	* src/inst/section.hh (has_label, get_offset): Update accordingly.
      	(register_label): Wait for a Label only and use it to get its offset.
      	* src/inst/data_section.hh: Update accordingly.
      	* src/inst/text_label.hh: New.
      	* src/inst/Makefile.am: Update accordingly.
      	* src/inst/text_section.hh: Create TextLabels instead of Labels.
      	* src/inst/text_section.cc: Include inst.hh to gain access
      	to Inst's interface.
      
      58ab9449
  18. 27 Jan, 2005 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · 24ea94c9
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Make LabelExp independent from Label.
      
      	* src/inst/exp.hh, src/inst/exp.cc:
      	Make LabelExp aggregate a unique_string instead of a Label.
      	* dev/parse-asm-scan-gen.py: Return a unique_string when 
      	scanning an identifier (instead	of a Label).
      	* dev/parse-asm-parse-gen.py: Update accordingly.
      	* src/inst/section.hh (has_label, get_offset): Wait for a
      	unique_string (instead of a Label).
      	* dev/inst-builder-gen.py, dev/inst-solver-gen.py,
      	* src/vm/virtual_machine.cc, src/shell/shell.cc:
      	Update accordingly.
      
      24ea94c9
  19. 26 Jan, 2005 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · 80ffde06
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Let concrete sections choose how to handle labels definitions.
      
      	* src/inst/section.hh (add_label): Rename as `register_label'.
      	* src/inst/data_section.hh, src/inst/text_section.hh:
      	(add_label): Rename as...
      	(define_label): This, and make it wait for a unique_string and 
      	build the label.
      	* dev/parse-asm-scan-gen.py: Return a unique_string on a 
      	label definition.
      	* dev/parse-asm-parse-gen.py: Update accordingly.
      
      Index: src/inst/data_section.hh
      --- src/inst/data_section.hh	(revision 160)
      +++ src/inst/data_section.hh	(working copy)
      @@ -54,9 +54,9 @@
           }
           
         public:
      -    void		add_label(Label *label)
      +    void		define_label(const misc::unique_string &id)
           {
      -      Section::add_label(label, size_);
      +      Section::register_label(new inst::Label(id), size_);
           }
           
         public:
      Index: src/inst/section.hh
      --- src/inst/section.hh	(revision 160)
      +++ src/inst/section.hh	(working copy)
      @@ -49,7 +49,7 @@
           {}
           
         protected:
      -    void		add_label(Label *label, int offset)
      +    void		register_label(Label *label, int offset)
           {
             // FIXME: check that this label has not already been added.
             offsets_[*label] = offset;
      Index: src/inst/text_section.hh
      --- src/inst/text_section.hh	(revision 160)
      +++ src/inst/text_section.hh	(working copy)
      @@ -54,9 +54,9 @@
           }
       
         public:
      -    void		add_label(Label *label)
      +    void		define_label(const misc::unique_string &id)
           {
      -      Section::add_label(label, insts_.size() * 4);
      +      Section::register_label(new inst::Label(id), insts_.size() * 4);
           }
       
         public:
      Index: dev/inst-builder-gen.py
      --- dev/inst-builder-gen.py	(revision 160)
      +++ dev/inst-builder-gen.py	(working copy)
      @@ -78,14 +78,14 @@
           }
           
         public:
      -    void		add_inst_label(Label *label)
      +    void		define_inst_label(const misc::unique_string &id)
           {
      -      program_->text_section ().add_label(label);
      +      program_->text_section ().define_label(id);
           }
       
      -    void		add_data_label(Label *label)
      +    void		define_data_label(const misc::unique_string &id)
           {
      -      program_->data_section ().add_label(label);
      +      program_->data_section ().define_label(id);
           }
       
         public:
      Index: dev/parse-asm-scan-gen.py
      --- dev/parse-asm-scan-gen.py	(revision 160)
      +++ dev/parse-asm-scan-gen.py	(working copy)
      @@ -71,7 +71,7 @@
       dec_int			[0-9]+
       hex_int			0x[0-9A-Fa-f]+
       
      -label			[a-zA-Z_][a-zA-Z_0-9]*
      +id			[a-zA-Z_][a-zA-Z_0-9]*
       %%
       
       %{
      @@ -144,14 +144,14 @@
       }
       
       
      -{label}			{
      +{id}			{
         yylval->label = new inst::Label (yytext);
         return LABEL;
       }
      -{label}\":\"		{
      +{id}\":\"		{
         std::string label = yytext;
         label.resize(yyleng - 1);
      -  yylval->label = new inst::Label (label);
      +  yylval->id = &misc::unique_string::create(label);
         return LABEL_DEF;
       }
       
      Index: dev/parse-asm-parse-gen.py
      --- dev/parse-asm-parse-gen.py	(revision 160)
      +++ dev/parse-asm-parse-gen.py	(working copy)
      @@ -75,6 +75,7 @@
       {
         int			i;
         std::string		*s;
      +  const misc::unique_string	*id;
         inst::Label           *label;
         inst::Register        *reg;
         inst::Exp             *exp;
      @@ -84,7 +85,7 @@
       %}
       
       %token <label> LABEL		\"label\"
      -%token <label> LABEL_DEF	\"label definition\"
      +%token <id> LABEL_DEF		\"label definition\"
       %token <i> INTEGER              \"integer\"
       %token <s> STRING               \"string\"
       %token <reg> REGISTER           \"register\"
      @@ -138,7 +139,7 @@
       data
       // Label
       :  LABEL_DEF
      -{ program_builder.add_data_label($1); }
      +{ program_builder.define_data_label(*$1); }
       
       // Uninitialized space
       | DIR_SPACE INTEGER
      @@ -169,7 +170,7 @@
       instruction
       // Label
       : LABEL_DEF
      -{ program_builder.add_inst_label($1); }
      +{ program_builder.define_inst_label(*$1); }
       
       // Opcodes"""
       
      80ffde06
  20. 24 Jan, 2005 3 commits
    • Benoit Perrot's avatar
      Index: ChangeLog · 661492f8
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Copy the instruction list of text section when storing one.
      
      	* src/inst/text_section.hh, dev/inst-solver-gen.py:
      	Hide the concrete type of instruction list.
      	* src/vm/mmu.hh: Aggregate the instructions instead of 
      	a text section.
      	(inst_store) Copy the instruction pointers into a local vector.
      	(inst_load) Access the local vector instead of text section. 
      
      661492f8
    • Benoit Perrot's avatar
      Index: ChangeLog · 4de60919
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Hide the text section loaded in virtual machine's memory.
      
      	* src/vm/mmu.hh (inst_has_label, inst_get_offset): Remove.
      	* src/vm/virtual_machine.hh (has_label, get_offset): Remove.
      	(add_breakpoint) Wait for an offset instead of a label.
      	* src/vm/virtual_machine.cc: Update accordingly, move label
      	translation into...
      	* src/shell/shell.cc (do_break): ...this method.
      
      4de60919
    • Benoit Perrot's avatar
      Index: ChangeLog · c7f88dcb
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Introduce some (weak) reentrancy into lexer.
      
      	* dev/parse-asm-scan-gen.py: Maintain a stack of scanning states.
      	This comes from the LRDE's Tiger Compiler's scanner.
      
      c7f88dcb
  21. 22 Jan, 2005 1 commit
    • Benoit Perrot's avatar
      Index: ChangeLog · 812bad96
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Fix shell's `load' command.
      	
      	* src/shell.hh: Implement destructor in corresponding .cc.
      	Aggregate the program being run.
      	* src/shell.cc (do_load): Recover on parse or solve error.
      	(do_load, do_run, do_continue, do-next, do_break) Use aggregated
      	program pointer instead of global one.
      
      812bad96
  22. 17 Jan, 2005 2 commits
    • Benoit Perrot's avatar
      Index: ChangeLog · fcb768de
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	* src/shell.hh (is_register, is_label, get_next_word): 
      	Rename and move into...
      	* src/shell.cc (eat_register, eat_label, eat_word):
      	This.
      
      fcb768de
    • Benoit Perrot's avatar
      Index: ChangeLog · d36d3f31
      Benoit Perrot authored
      from  Benoît Perrot  <benoit@lrde.epita.fr>
      
      	Introduce utilities for lexical analysis.
      	
      	* src/misc/lexutils.hh, src/misc/lexutils.cc:
      	Pack utilities for lexical analysis in these files.
      	* src/misc/Makefile.am: Update accordingly.
      	* src/shell/shell.hh, src/shell/shell.cc:
      	Use lexutils.
      
      d36d3f31