ijtag 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/config/application.rb +103 -0
- data/config/boot.rb +17 -0
- data/config/commands.rb +74 -0
- data/config/version.rb +8 -0
- data/lib/ijtag.rb +13 -0
- data/lib/ijtag/icl/parser.rb +35 -0
- data/lib/tasks/ijtag.rake +6 -0
- data/templates/web/index.md.erb +37 -0
- data/templates/web/layouts/_basic.html.erb +13 -0
- data/templates/web/partials/_navbar.html.erb +20 -0
- data/templates/web/release_notes.md.erb +5 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7341a2bb4f9a7f8c822b1189c4febfeda1762319
|
4
|
+
data.tar.gz: 96026fcaa5235b8771e3eae440e542d86d2e6a60
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7342ca96d7c41c78cf119ff3b47fcfc7355be99036268cf3d3293695dc6dab1b078f557cc9c5a495172af94b68fd6f5b1e96168b4fddd70218da6e83e68628b5
|
7
|
+
data.tar.gz: 427d46c2568dcfd714872231f982114999f3223cbc7f85e3ec90a28c0bd4a598d070de5515fee5e8eb4eeeee7aa0d331d78f93c23181dad64beb599c6e67c252
|
@@ -0,0 +1,103 @@
|
|
1
|
+
require 'origen'
|
2
|
+
class IJTAGApplication < Origen::Application
|
3
|
+
|
4
|
+
# See http://origen-sdk.org/origen/api/Origen/Application/Configuration.html
|
5
|
+
# for a full list of the configuration options available
|
6
|
+
|
7
|
+
# These attributes should never be changed, the duplication here will be resolved in future
|
8
|
+
# by condensing these attributes that do similar things
|
9
|
+
self.name = "ijtag"
|
10
|
+
self.namespace = "IJTAG"
|
11
|
+
config.name = "ijtag"
|
12
|
+
config.initials = "IJTAG"
|
13
|
+
# Change this to point to the revision control repository for this plugin
|
14
|
+
config.rc_url = "ssh://git@github.com:Origen-SDK/ijtag.git"
|
15
|
+
config.release_externally = true
|
16
|
+
|
17
|
+
# To enable deployment of your documentation to a web server (via the 'origen web'
|
18
|
+
# command) fill in these attributes.
|
19
|
+
config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/ijtag"
|
20
|
+
config.web_domain = "http://origen-sdk.org/ijtag"
|
21
|
+
|
22
|
+
# When false Origen will be less strict about checking for some common coding errors,
|
23
|
+
# it is recommended that you leave this to true for better feedback and easier debug.
|
24
|
+
# This will be the default setting in Origen v3.
|
25
|
+
config.strict_errors = true
|
26
|
+
|
27
|
+
# See: http://origen-sdk.org/origen/latest/guides/utilities/lint/
|
28
|
+
config.lint_test = {
|
29
|
+
# Require the lint tests to pass before allowing a release to proceed
|
30
|
+
run_on_tag: true,
|
31
|
+
# Auto correct violations where possible whenever 'origen lint' is run
|
32
|
+
auto_correct: true,
|
33
|
+
# Limit the testing for large legacy applications
|
34
|
+
#level: :easy,
|
35
|
+
# Run on these directories/files by default
|
36
|
+
#files: ["lib", "config/application.rb"],
|
37
|
+
}
|
38
|
+
|
39
|
+
config.semantically_version = true
|
40
|
+
|
41
|
+
# An example of how to set application specific LSF parameters
|
42
|
+
#config.lsf.project = "msg.te"
|
43
|
+
|
44
|
+
# An example of how to specify a prefix to add to all generated patterns
|
45
|
+
#config.pattern_prefix = "nvm"
|
46
|
+
|
47
|
+
# An example of how to add header comments to all generated patterns
|
48
|
+
#config.pattern_header do
|
49
|
+
# cc "This is a pattern created by the example origen application"
|
50
|
+
#end
|
51
|
+
|
52
|
+
# By default all generated output will end up in ./output.
|
53
|
+
# Here you can specify an alternative directory entirely, or make it dynamic such that
|
54
|
+
# the output ends up in a setup specific directory.
|
55
|
+
#config.output_directory do
|
56
|
+
# "#{Origen.root}/output/#{$dut.class}"
|
57
|
+
#end
|
58
|
+
|
59
|
+
# Similarly for the reference files, generally you want to setup the reference directory
|
60
|
+
# structure to mirror that of your output directory structure.
|
61
|
+
#config.reference_directory do
|
62
|
+
# "#{Origen.root}/.ref/#{$dut.class}"
|
63
|
+
#end
|
64
|
+
|
65
|
+
# This will automatically deploy your documentation after every tag
|
66
|
+
#def after_release_email(tag, note, type, selector, options)
|
67
|
+
# command = "origen web compile --remote --api"
|
68
|
+
# Dir.chdir Origen.root do
|
69
|
+
# system command
|
70
|
+
# end
|
71
|
+
#end
|
72
|
+
|
73
|
+
# Ensure that all tests pass before allowing a release to continue
|
74
|
+
#def validate_release
|
75
|
+
# if !system("origen specs") || !system("origen examples")
|
76
|
+
# puts "Sorry but you can't release with failing tests, please fix them and try again."
|
77
|
+
# exit 1
|
78
|
+
# else
|
79
|
+
# puts "All tests passing, proceeding with release process!"
|
80
|
+
# end
|
81
|
+
#end
|
82
|
+
|
83
|
+
# To enabled source-less pattern generation create a class (for example PatternDispatcher)
|
84
|
+
# to generate the pattern. This should return false if the requested pattern has been
|
85
|
+
# dispatched, otherwise Origen will proceed with looking up a pattern source as normal.
|
86
|
+
#def before_pattern_lookup(requested_pattern)
|
87
|
+
# PatternDispatcher.new.dispatch_or_return(requested_pattern)
|
88
|
+
#end
|
89
|
+
|
90
|
+
# If you use pattern iterators you may come across the case where you request a pattern
|
91
|
+
# like this:
|
92
|
+
# origen g example_pat_b0.atp
|
93
|
+
#
|
94
|
+
# However it cannot be found by Origen since the pattern name is actually example_pat_bx.atp
|
95
|
+
# In the case where the pattern cannot be found Origen will pass the name to this translator
|
96
|
+
# if it exists, and here you can make any substitutions to help Origen find the file you
|
97
|
+
# want. In this example any instances of _b\d, where \d means a number, are replaced by
|
98
|
+
# _bx.
|
99
|
+
#config.pattern_name_translator do |name|
|
100
|
+
# name.gsub(/_b\d/, "_bx")
|
101
|
+
#end
|
102
|
+
|
103
|
+
end
|
data/config/boot.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file is used to boot your plugin when it is running in standalone mode
|
2
|
+
# from its own workspace - i.e. when the plugin is being developed.
|
3
|
+
#
|
4
|
+
# It will not be loaded when the plugin is imported by a 3rd party app - in that
|
5
|
+
# case only lib/i_jtag.rb is loaded.
|
6
|
+
#
|
7
|
+
# Therefore this file can be used to load anything extra that you need to boot
|
8
|
+
# the development environment for this app. For example this is typically used
|
9
|
+
# to load some additional test classes to use your plugin APIs so that they can
|
10
|
+
# be tested and/or interacted with in the console.
|
11
|
+
require "ijtag"
|
12
|
+
|
13
|
+
# Load a Top-level/DUT class that is defined within this plugin's lib directory
|
14
|
+
# and is required by some of our tests.
|
15
|
+
# Normally such a class should not be exposed to 3rd party users of the plugin,
|
16
|
+
# so we required it here rather than in lib/i_jtag.rb.
|
17
|
+
#require "i_jtag/test/top_level"
|
data/config/commands.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# This file should be used to extend the origen with application specific commands
|
2
|
+
|
3
|
+
# Map any command aliases here, for example to allow 'origen ex' to refer to a
|
4
|
+
# command called execute you would add a reference as shown below:
|
5
|
+
aliases ={
|
6
|
+
# "ex" => "execute",
|
7
|
+
}
|
8
|
+
|
9
|
+
# The requested command is passed in here as @command, this checks it against
|
10
|
+
# the above alias table and should not be removed.
|
11
|
+
@command = aliases[@command] || @command
|
12
|
+
|
13
|
+
# Now branch to the specific task code
|
14
|
+
case @command
|
15
|
+
|
16
|
+
# Here is an example of how to implement a command, the logic can go straight
|
17
|
+
# in here or you can require an external file if preferred.
|
18
|
+
when "my_command"
|
19
|
+
puts "Doing something..."
|
20
|
+
#require "commands/my_command" # Would load file lib/commands/my_command.rb
|
21
|
+
# You must always exit upon successfully capturing a command to prevent
|
22
|
+
# control flowing back to Origen
|
23
|
+
exit 0
|
24
|
+
|
25
|
+
# Example of how to make a command to run unit tests, this simply invokes RSpec on
|
26
|
+
# the spec directory
|
27
|
+
when "specs"
|
28
|
+
require "rspec"
|
29
|
+
exit RSpec::Core::Runner.run(['spec'])
|
30
|
+
|
31
|
+
## Example of how to make a command to run diff-based tests
|
32
|
+
#when "examples", "test"
|
33
|
+
# Origen.load_application
|
34
|
+
# status = 0
|
35
|
+
#
|
36
|
+
# # Compiler tests
|
37
|
+
# ARGV = %w(templates/example.txt.erb -t debug -r approved)
|
38
|
+
# load "origen/commands/compile.rb"
|
39
|
+
# # Pattern generator tests
|
40
|
+
# #ARGV = %w(some_pattern -t debug -r approved)
|
41
|
+
# #load "#{Origen.top}/lib/origen/commands/generate.rb"
|
42
|
+
#
|
43
|
+
# if Origen.app.stats.changed_files == 0 &&
|
44
|
+
# Origen.app.stats.new_files == 0 &&
|
45
|
+
# Origen.app.stats.changed_patterns == 0 &&
|
46
|
+
# Origen.app.stats.new_patterns == 0
|
47
|
+
#
|
48
|
+
# Origen.app.stats.report_pass
|
49
|
+
# else
|
50
|
+
# Origen.app.stats.report_fail
|
51
|
+
# status = 1
|
52
|
+
# end
|
53
|
+
# puts
|
54
|
+
# if @command == "test"
|
55
|
+
# Origen.app.unload_target!
|
56
|
+
# require "rspec"
|
57
|
+
# result = RSpec::Core::Runner.run(['spec'])
|
58
|
+
# status = status == 1 ? 1 : result
|
59
|
+
# end
|
60
|
+
# exit status # Exit with a 1 on the event of a failure per std unix result codes
|
61
|
+
|
62
|
+
# Always leave an else clause to allow control to fall back through to the
|
63
|
+
# Origen command handler.
|
64
|
+
else
|
65
|
+
# You probably want to also add the your commands to the help shown via
|
66
|
+
# origen -h, you can do this be assigning the required text to @application_commands
|
67
|
+
# before handing control back to Origen. Un-comment the example below to get started.
|
68
|
+
@application_commands = <<-EOT
|
69
|
+
specs Run the specs (tests), -c will enable coverage
|
70
|
+
EOT
|
71
|
+
# examples Run the examples (tests), -c will enable coverage
|
72
|
+
# test Run both specs and examples, -c will enable coverage
|
73
|
+
|
74
|
+
end
|
data/config/version.rb
ADDED
data/lib/ijtag.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'origen'
|
2
|
+
require_relative '../config/application.rb'
|
3
|
+
module IJTAG
|
4
|
+
# Load all files in the lib directory via a wildcard, if your project becomes
|
5
|
+
# large or load order dependencies start to creep in then you may need to
|
6
|
+
# start taking control of this manually as described above.
|
7
|
+
# Note that there is no problem from requiring a file twice (Ruby will ignore
|
8
|
+
# the second require), so if you have a file that must be required up front
|
9
|
+
# you can do that one manually and the let the wildcard take care of the rest.
|
10
|
+
Dir.glob("#{File.dirname(__FILE__)}/**/*.rb").sort.each do |file|
|
11
|
+
require file
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'treetop'
|
2
|
+
module IJTAG
|
3
|
+
module ICL
|
4
|
+
# Responsible for parsing an 1687 ICL file to an AST
|
5
|
+
class Parser
|
6
|
+
def self.parse(data)
|
7
|
+
tree = parser.parse(data)
|
8
|
+
|
9
|
+
# If the AST is nil then there was an error during parsing
|
10
|
+
# we need to report a simple error message to help the user
|
11
|
+
if tree.nil?
|
12
|
+
parser.failure_reason =~ /^(Expected .+) (after|at)/m
|
13
|
+
@last_error_msg = []
|
14
|
+
@last_error_msg << "#{Regexp.last_match(1).gsub("\n", '$NEWLINE')}:"
|
15
|
+
@last_error_msg << data.lines.to_a[parser.failure_line - 1]
|
16
|
+
@last_error_msg << "#{'~' * (parser.failure_column - 1)}^"
|
17
|
+
puts @last_error_msg
|
18
|
+
end
|
19
|
+
tree
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.last_error_msg
|
23
|
+
@last_error_msg || []
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.parser
|
27
|
+
@parser ||= begin
|
28
|
+
grammar = File.join(File.expand_path(File.dirname(__FILE__)), 'grammar.treetop')
|
29
|
+
Treetop.load(grammar)
|
30
|
+
GrammarParser.new
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# You can define any Rake tasks to support your application here (or in any file
|
2
|
+
# ending in .rake in this directory).
|
3
|
+
#
|
4
|
+
# Rake (Ruby Make) is very useful for creating build scripts, see this short video
|
5
|
+
# for a quick introduction:
|
6
|
+
# http://railscasts.com/episodes/66-custom-rake-tasks
|
@@ -0,0 +1,37 @@
|
|
1
|
+
% render "layouts/basic.html" do
|
2
|
+
|
3
|
+
%# HTML tags can be embedded in mark down files if you want to do specific custom
|
4
|
+
%# formatting like this, but in most cases that is not required.
|
5
|
+
<h1><%= Origen.app.namespace %> <span style="font-size: 14px">(<%= Origen.app.version %>)</span></h1>
|
6
|
+
|
7
|
+
### Purpose
|
8
|
+
|
9
|
+
This plugin...
|
10
|
+
|
11
|
+
### How To Install
|
12
|
+
|
13
|
+
In your Gemfile add:
|
14
|
+
|
15
|
+
~~~ruby
|
16
|
+
gem "<%= Origen.app.name %>"
|
17
|
+
~~~
|
18
|
+
|
19
|
+
or if your application is a plugin, then add this to your <code>.gemspec</code>
|
20
|
+
|
21
|
+
~~~ruby
|
22
|
+
spec.add_runtime_dependency "<%= Origen.app.name %>", ">= <%= Origen.app.version %>"
|
23
|
+
~~~
|
24
|
+
|
25
|
+
__NOTE:__ In the case of a plugin, you will also need to <code>require '<%= Origen.app.name %>'</code> somewhere in your environment.
|
26
|
+
|
27
|
+
|
28
|
+
### How To Use
|
29
|
+
|
30
|
+
Add quickstart documentation here...
|
31
|
+
|
32
|
+
|
33
|
+
### How To Setup a Development Environment
|
34
|
+
|
35
|
+
Describe how a developer would setup a new workspace for this plugin...
|
36
|
+
|
37
|
+
% end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
title: <%= options[:title] || Origen.config.name %>
|
3
|
+
---
|
4
|
+
<%= render "partials/navbar.html", tab: options[:tab] %>
|
5
|
+
|
6
|
+
<div class="row">
|
7
|
+
%# The markdown attribute is important if you are going to include content written
|
8
|
+
%# in markdown, without this is will be included verbatim
|
9
|
+
<div class="span12" markdown="1">
|
10
|
+
<%= yield %>
|
11
|
+
|
12
|
+
</div>
|
13
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<nav class="navbar navbar-inverse navbar-fixed-top">
|
2
|
+
<div class="container">
|
3
|
+
<div class="navbar-header">
|
4
|
+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
5
|
+
<span class="sr-only">Toggle navigation</span>
|
6
|
+
<span class="icon-bar"></span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
<span class="icon-bar"></span>
|
9
|
+
</button>
|
10
|
+
<a class="navbar-brand" href="<%= path "/" %>">Home</a>
|
11
|
+
</div>
|
12
|
+
<div id="navbar" class="collapse navbar-collapse">
|
13
|
+
<ul class="nav navbar-nav">
|
14
|
+
<li class="<%= options[:tab] == :api ? 'active' : '' %>"><a href="<%= path "/api/" %>">API</a></li>
|
15
|
+
<li class="<%= options[:tab] == :release ? 'active' : '' %>"><a href="<%= path "/release_notes" %>">Release Notes</a></li>
|
16
|
+
</ul>
|
17
|
+
<%= import "origen/web/logo.html" %>
|
18
|
+
</div><!--/.nav-collapse -->
|
19
|
+
</div>
|
20
|
+
</nav>
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ijtag
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stephen McGinty
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: origen
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.5.7
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.5.7
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: treetop
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: origen_doc_helpers
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- stephen.mcginty@freescale.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- config/application.rb
|
63
|
+
- config/boot.rb
|
64
|
+
- config/commands.rb
|
65
|
+
- config/version.rb
|
66
|
+
- lib/ijtag.rb
|
67
|
+
- lib/ijtag/icl/parser.rb
|
68
|
+
- lib/tasks/ijtag.rake
|
69
|
+
- templates/web/index.md.erb
|
70
|
+
- templates/web/layouts/_basic.html.erb
|
71
|
+
- templates/web/partials/_navbar.html.erb
|
72
|
+
- templates/web/release_notes.md.erb
|
73
|
+
homepage: http://origen-sdk.org/ijtag
|
74
|
+
licenses: []
|
75
|
+
metadata: {}
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options: []
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '2'
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.8.11
|
90
|
+
requirements: []
|
91
|
+
rubyforge_project:
|
92
|
+
rubygems_version: 2.2.2
|
93
|
+
signing_key:
|
94
|
+
specification_version: 4
|
95
|
+
summary: Origen interface/driver for the IEEE 1687 (IJTAG) standard
|
96
|
+
test_files: []
|
97
|
+
has_rdoc:
|