Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
/test/tmp/
/test/version_tmp/
/tmp/
/sim_lib/generated
IR.json
IR.yaml
/lib/Devices/serial.c

# Used by dotenv library to load environment variables.
# .env
Expand Down
37 changes: 5 additions & 32 deletions lib/ADL/builder.rb
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
require_relative "scope"
require "Common/scope"
require "Utility/type"

module SimInfra
class IrStmt
attr_reader :name, :oprnds, :attrs
def initialize(name, oprnds, attrs)
@name = name; @oprnds = oprnds; @attrs = attrs;
end

def to_h
{
name: @name,
oprnds: @oprnds.map { |o|
if o.class == Var || o.class == Constant
o.to_h
else
o
end
},
attrs: @attrs,
}
end

def self.from_h(h)
IrStmt.new(h[:name], h[:oprnds], h[:attrs])
end
end
end

# Basics
module SimInfra
module Protea
def assert(condition, msg = nil); raise msg if !condition; end

@@instructions = []
Expand Down Expand Up @@ -75,7 +48,7 @@ def self.from_h(h)
end

class InstructionInfoBuilder
include SimInfra
include Protea

def initialize(name, feature)
@info = InstructionInfo.new(name, feature)
Expand Down Expand Up @@ -127,7 +100,7 @@ def Instruction(name, &block)
end

class InterfaceBuilder
include SimInfra
include Protea

def function(name, output_types = [], input_types = [])
@@interface_functions << {:name => name, :return_types => output_types, :argument_types => input_types}
Expand Down Expand Up @@ -201,7 +174,7 @@ def RegFiles()
end

# * generate precise fields
module SimInfra
module Protea
class RegisterFileBuilder
def r32(sym, *args)
@info.regs << Register.new(sym, 32, args[0] ? [args[0]] : [])
Expand Down
92 changes: 0 additions & 92 deletions lib/ADL/var.rb

This file was deleted.

4 changes: 2 additions & 2 deletions lib/ADL/base.rb → lib/Common/base.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative "value"
# Testing infra

module SimInfra
module Protea
# @@instructions -array of instruction description
# shows result of our tests in interactive Ruby (IRB) or standalone
def self.serialize(msg= nil)
Expand Down Expand Up @@ -44,7 +44,7 @@ def self.state
end

# reset state
def siminfra_reset_module_state; @@instructions = []; end
def Protea_reset_module_state; @@instructions = []; end

# mixin for global counter, function returns 0,1,2,....
module GlobalCounter
Expand Down
Loading