origen_ahb 0.2.0.pre2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d6aaf5011cdd5d3328aef9c3feeebffcf324d4a9
4
+ data.tar.gz: 76f66169b9bead42f206a0d84d92597fb13f4628
5
+ SHA512:
6
+ metadata.gz: 436df5b100adc4d4e645c1c819e48690c8050558c61dbf4d59b4de33e024dd935f25833d823e4bc7cee48495a7f42b8c0214f59e571874c5f1bf113bb06baf48
7
+ data.tar.gz: f330f2d3b46a976d132a4ef74ed961b345748869287bd02f87622eaeb50c9462559184c83107e8da9cf636252172fd9c00da09ac2a5f43e3477335ad266118fa
@@ -0,0 +1,59 @@
1
+ class OrigenAhbApplication < Origen::Application
2
+
3
+ # This information is used in headers and email templates, set it specific
4
+ # to your application
5
+ config.name = "origen ahb"
6
+ config.initials = "OrigenAhb"
7
+
8
+ self.name = "origen_ahb"
9
+ self.namespace = "OrigenAhb"
10
+ config.rc_url = "git@github.com:Origen-SDK/origen_ahb.git"
11
+ config.release_externally = true
12
+
13
+ # To enable deployment of your documentation to a web server (via the 'origen web'
14
+ # command) fill in these attributes.
15
+ config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/ahb"
16
+ config.web_domain = "http://origen-sdk.org/ahb"
17
+
18
+ config.semantically_version = true
19
+
20
+ config.lint_test = {
21
+ # Require the lint tests to pass before allowing a release to proceed
22
+ run_on_tag: true,
23
+ # Auto correct violations where possible whenever 'origen lint' is run
24
+ auto_correct: true,
25
+ # Limit the testing for large legacy applications
26
+ level: :easy,
27
+ # Run on these directories/files by default
28
+ #files: ["lib", "config/application.rb"],
29
+ }
30
+
31
+ # Ensure that all tests pass before allowing a release to continue
32
+ def validate_release
33
+ if !system("origen examples") || !system("origen specs")
34
+ puts "Sorry but you can't release with failing tests, please fix them and try again."
35
+ exit 1
36
+ else
37
+ puts "All tests passing, proceeding with release process!"
38
+ end
39
+ end
40
+
41
+ # Run code coverage when deploying the web site
42
+ def before_deploy_site
43
+ Dir.chdir Origen.root do
44
+ system "origen examples -c"
45
+ dir = "#{Origen.root}/web/output/coverage"
46
+ FileUtils.remove_dir(dir, true) if File.exists?(dir)
47
+ system "mv #{Origen.root}/coverage #{dir}"
48
+ end
49
+ end
50
+
51
+ # Deploy the website automatically after a production tag
52
+ def after_release_email(tag, note, type, selector, options)
53
+ command = "origen web compile --remote --api"
54
+ Dir.chdir Origen.root do
55
+ system command
56
+ end
57
+ end
58
+
59
+ end
@@ -0,0 +1,81 @@
1
+ # This file should be used to extend the rgen command line tool with tasks
2
+ # specific to your application.
3
+ # The comments below should help to get started and you can also refer to
4
+ # lib/rgen/commands.rb in your RGen core workspace for more examples and
5
+ # inspiration.
6
+ #
7
+ # Also see the official docs on adding commands:
8
+ # http://rgen.freescale.net/rgen/latest/guides/custom/commands/
9
+
10
+ # Map any command aliases here, for example to allow 'rgen ex' to refer to a
11
+ # command called execute you would add a reference as shown below:
12
+ aliases ={
13
+ # "ex" => "execute",
14
+ }
15
+
16
+ # The requested command is passed in here as @command, this checks it against
17
+ # the above alias table and should not be removed.
18
+ @command = aliases[@command] || @command
19
+
20
+ # Now branch to the specific task code
21
+ case @command
22
+
23
+ # Here is an example of how to implement a command, the logic can go straight
24
+ # in here or you can require an external file if preferred.
25
+ when "my_command"
26
+ puts "Doing something..."
27
+ require "commands/my_command" # Would load file lib/commands/my_command.rb
28
+ # You must always exit upon successfully capturing a command to prevent
29
+ # control flowing back to RGen
30
+ exit 0
31
+
32
+ ## Example of how to make a command to run unit tests, this simply invokes RSpec on
33
+ ## the spec directory
34
+ #when "specs"
35
+ # ARGV.unshift "spec"
36
+ # require "rspec"
37
+ # require "rspec/autorun"
38
+ # exit 0 # This will never be hit on a fail, RSpec will automatically exit 1
39
+
40
+ ## Example of how to make a command to run diff-based tests
41
+ when "examples"
42
+ # RGen.load_application
43
+ status = 0
44
+ #
45
+ # # Compiler tests
46
+ # ARGV = %w(templates/example.txt.erb -t debug -r approved)
47
+ # load "rgen/commands/compile.rb"
48
+ # # Pattern generator tests
49
+ # #ARGV = %w(some_pattern -t debug -r approved)
50
+ # #load "#{RGen.top}/lib/rgen/commands/generate.rb"
51
+ #
52
+ # if RGen.app.stats.changed_files == 0 &&
53
+ # RGen.app.stats.new_files == 0 &&
54
+ # RGen.app.stats.changed_patterns == 0 &&
55
+ # RGen.app.stats.new_patterns == 0
56
+ #
57
+ # RGen.app.stats.report_pass
58
+ # else
59
+ # RGen.app.stats.report_fail
60
+ # status = 1
61
+ # end
62
+ # puts
63
+ exit status # Exit with a 1 on the event of a failure per std unix result codes
64
+
65
+ # Always leave an else clause to allow control to fall back through to the
66
+ # RGen command handler.
67
+ #else
68
+ # You probably want to also add the your commands to the help shown via
69
+ # rgen -h, you can do this be assigning the required text to @application_commands
70
+ # before handing control back to RGen. Un-comment the example below to get started.
71
+ # @application_commands = <<-EOT
72
+ # specs Run the specs (tests), -c will enable coverage
73
+ # examples Run the examples (tests), -c will enable coverage
74
+ # EOT
75
+
76
+
77
+ when "specs"
78
+ status = 0
79
+ exit status
80
+
81
+ end #case
@@ -0,0 +1,12 @@
1
+ # This file is similar to environment.rb and will be loaded
2
+ # automatically at the start of each invocation of RGen.
3
+ #
4
+ # However the major difference is that it will not be loaded
5
+ # if the application is imported by a 3rd party app - in that
6
+ # case only environment.rb is loaded.
7
+ #
8
+ # Therefore this file should be used to load anything you need
9
+ # to setup a development environment for this app, normally
10
+ # this would be used to load some dummy classes to instantiate
11
+ # your objects so that they can be tested and/or interacted with
12
+ # in the console.
@@ -0,0 +1,4 @@
1
+ # This file will be loaded by RGen to boot your application, just leave it as
2
+ # is and modify lib/origen_ahb.rb to load the additional resources that your
3
+ # application requires
4
+ require "origen_ahb"
data/config/users.rb ADDED
@@ -0,0 +1,29 @@
1
+ # This file defines the users associated with your project, it is basically the
2
+ # mailing list for release notes.
3
+ #
4
+ # You can split your users into "admin" and "user" groups, the main difference
5
+ # between the two is that admin users will get all tag emails, users will get
6
+ # emails on external/official releases only.
7
+ #
8
+ # Users are also prohibited from running the "rgen rc tag" command, but this is
9
+ # really just to prevent a casual user from executing it inadvertently and is
10
+ # not intended to be a serious security gate.
11
+ module RGen
12
+ module Users
13
+ def users
14
+ @users ||= [
15
+
16
+ # Admins - Notified on every tag
17
+ User.new("Chris P Nappi", "ra5809", :admin),
18
+
19
+ # Users - Notified on official release tags only
20
+ #User.new("Stephen McGinty", "r49409"),
21
+ # The r-number attribute can be anything that can be prefixed to an
22
+ # @freescale.com email address, so you can add mailing list references
23
+ # as well like this:
24
+ #User.new("RGen Users", "rgen"), # The RGen mailing list
25
+
26
+ ]
27
+ end
28
+ end
29
+ end
data/config/version.rb ADDED
@@ -0,0 +1,8 @@
1
+ module OrigenAhb
2
+ MAJOR = 0
3
+ MINOR = 2
4
+ BUGFIX = 0
5
+ DEV = 2
6
+
7
+ VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
+ end
@@ -0,0 +1,56 @@
1
+ module OrigenAhb
2
+ class Driver
3
+ attr_reader :owner
4
+
5
+ def initialize(owner, options = {})
6
+ @owner = owner
7
+ end
8
+
9
+ def read_register(reg_or_val, options = {})
10
+ options = {
11
+ haddr: reg_or_val.address,
12
+ hdata: reg_or_val.data,
13
+ hwrite: 0,
14
+ hsize: get_hsize(reg_or_val.size),
15
+ hburst: 0,
16
+ hmastlock: 0,
17
+ hprot: 0xF
18
+ }.merge(options)
19
+ $dut.ahb_trans(options)
20
+ end
21
+
22
+ def write_register(reg_or_val, options = {})
23
+ options = {
24
+ haddr: reg_or_val.address,
25
+ hdata: reg_or_val.data,
26
+ hwrite: 1,
27
+ hsize: get_hsize(reg_or_val.size),
28
+ hburst: 0,
29
+ hmastlock: 0,
30
+ hprot: 0xF
31
+ }.merge(options)
32
+ $dut.ahb_trans(options)
33
+ end
34
+
35
+ def get_hsize(size)
36
+ if size <= 8
37
+ hsize = 0
38
+ elsif size > 8 and size <= 16
39
+ hsize = 1
40
+ elsif size > 16 and size <= 32
41
+ hsize = 2
42
+ elsif size > 32 and size <= 64
43
+ hsize = 3
44
+ elsif size > 64 and size <= 128
45
+ hsize = 4
46
+ elsif size > 128 and size <= 256
47
+ hsize = 5
48
+ elsif size > 256 and size <= 512
49
+ hsize = 6
50
+ elsif size > 512 and size <= 1024
51
+ hsize = 7
52
+ end
53
+ get_hsize = hsize
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,4 @@
1
+ module OrigenAhb
2
+ class Interface
3
+ end
4
+ end
@@ -0,0 +1,12 @@
1
+ module OrigenAhb
2
+ class TopLevel
3
+ # A simple method to get you going, to see this in action run a console session like this:
4
+ #
5
+ # rgen i
6
+ #
7
+ # > $dut.hi
8
+ def hi
9
+ puts 'Hello master!'
10
+ end
11
+ end
12
+ end
data/lib/origen_ahb.rb ADDED
@@ -0,0 +1,22 @@
1
+ require 'origen_testers'
2
+ require 'origen'
3
+ require_relative '../config/application.rb'
4
+ module OrigenAhb
5
+ # Load all files in the lib directory via a wildcard, if your project becomes
6
+ # large or load order dependencies start to creep in then you may need to
7
+ # start taking control of this manually as described above.
8
+ # Note that there is no problem from requiring a file twice (Ruby will ignore
9
+ # the second require), so if you have a file that must be required up front
10
+ # you can do that one manually and the let the wildcard take care of the rest.
11
+ Dir.glob("#{File.dirname(__FILE__)}/**/*.rb").sort.each do |file|
12
+ require file
13
+ end
14
+
15
+ # Returns an instance of the OrigenAhb::Driver
16
+ def ahb
17
+ @origen_ahb ||= Driver.new(self)
18
+ end
19
+ end
20
+
21
+ # Add some aliases to handle common typos
22
+ # AHB = ahb
@@ -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
data/program/prb1.rb ADDED
@@ -0,0 +1,9 @@
1
+ Flow.create interface: 'OrigenAhb::Interface' do
2
+
3
+ if_job :p1 do
4
+ functional :test1, bin: 10, id: :t1
5
+
6
+ functional :test2, bin: 15, if_failed: :t1
7
+ end
8
+
9
+ end
@@ -0,0 +1,11 @@
1
+ % render "layouts/basic.html", tab: :archive do
2
+
3
+ ## Archive
4
+
5
+ Documentation from previous releases is available via the links below:
6
+
7
+ % RGen.app.versions.reverse_each do |version|
8
+ * [<%= version %>](<%= RGen.app.config.web_domain %>/<%= version.gsub(".", "_") %>)
9
+ % end
10
+
11
+ % end
@@ -0,0 +1,36 @@
1
+ % render "layouts/basic.html", tab: :contact do
2
+
3
+ ## Contact Us
4
+
5
+ The following engineers can be contacted about this application:
6
+
7
+ % RGen.app.developers.each do |user|
8
+ * [<%= user.name %>](http://freeshare.freescale.net:2222/my/Person.aspx?accountname=fsl\<%= user.r_number %>)
9
+ % end
10
+
11
+ %# An example of how to manually write a more detailed contact page:
12
+ %#Please use PDM For any bug reports or change/feature requests:
13
+ %#
14
+ %#* [C90TFS_NVM_tester on PDM](http://designpdm.freescale.net/Agile/PLMServlet?fromPCClient=true&module=PartFamilyHandler&requestUrl=module%3DPartFamilyHandler%26opcode%3DdisplayObject%26classid%3D2000004409%26objid%3D17718323%26tabid%3D2%26)
15
+ %#
16
+ %#For test related issues you can contact:
17
+ %#
18
+ %#* [Stephen McGinty](http://freeshare.freescale.net:2222/my/Person.aspx?accountname=fsl\r49409)
19
+ %#* [Thao Huynh](http://freeshare.freescale.net:2222/my/Person.aspx?accountname=fsl\R6AANF)
20
+ %#
21
+ %#For product/yield issues contact:
22
+ %#
23
+ %#* [Andrew Hardell](http://freeshare.freescale.net:2222/my/Person.aspx?accountname=fsl\R12635)
24
+ %#* [Eddie Lepore](http://freeshare.freescale.net:2222/my/Person.aspx?accountname=fsl\B06626)
25
+ %#
26
+ %#The manager of this project is:
27
+ %#
28
+ %#* [Wendy Malloch](http://freeshare.freescale.net:2222/my/Person.aspx?accountname=fsl\TTZ231)
29
+ %#
30
+ %#
31
+ %#Finally if you are not sure who to contact, or if your question may have device/reliability
32
+ %#implications, then you can use the Split Gate Flash Test and Reliability mailing list:
33
+ %#
34
+ %#* [Email SGFTANDR](mailto:SGFTANDR@freescale.com)
35
+
36
+ % end
@@ -0,0 +1,60 @@
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><%= RGen.app.namespace %> <span style="font-size: 14px">(<%= RGen.app.version %>)</span></h1>
6
+
7
+ ### Purpose
8
+
9
+ This plugin provides...
10
+
11
+ ### How To Import
12
+
13
+ ##### To use in an application:
14
+
15
+ Add the following to your application's <code>Gemfile</code>:
16
+
17
+ ~~~ruby
18
+ gem '<%= RGen.app.name %>', '<%= RGen.app.version %>'
19
+ ~~~
20
+
21
+ ##### To use in a plugin:
22
+
23
+ Add the following to your plugin's gemspec:
24
+
25
+ ~~~ruby
26
+ spec.add_runtime_dependency '<%= RGen.app.name %>', '~> <%= RGen.app.version.major %>', '>= <%= RGen.app.version %>'
27
+ ~~~
28
+
29
+ and require the gem in your code:
30
+
31
+ ~~~ruby
32
+ require '<%= RGen.app.name %>'
33
+ ~~~
34
+
35
+
36
+ ### How To Use
37
+
38
+ Give some quick start description here on how to use your plugin, providing
39
+ links to the API documents where necessary for further details.
40
+
41
+ Here is an example integration:
42
+
43
+ ~~~ruby
44
+ # Include some code examples here
45
+ ~~~
46
+
47
+ ### How To Setup a Development Environment
48
+
49
+ ~~~text
50
+ mkdir <%= RGen.app.name %>
51
+ cd <%= RGen.app.name %>
52
+ dssc setvault <%= RGen.app.config.vault %> .
53
+ dssc pop -rec -get .
54
+ ~~~
55
+
56
+ Follow the instructions here if you want to make a 3rd party app
57
+ workspace use your development copy of the <%= RGen.app.name %> plugin:
58
+ [Setting up a Plugin Development Environment](http://rgen.freescale.net/rgen/latest/guides/libraries/environment)
59
+
60
+ % end
@@ -0,0 +1,14 @@
1
+ ---
2
+ layout: bootstrap
3
+ title: <%= options[:title] || RGen.app.namespace %>
4
+ ---
5
+ <%= render "templates/web/partials/navbar.html", tab: options[:tab] %>
6
+
7
+ <div class="row">
8
+ %# The markdown attribute is important if you are going to include content written
9
+ %# in markdown, without this is will be included verbatim
10
+ <div class="span12" markdown="1">
11
+ <%= yield %>
12
+
13
+ </div>
14
+ </div>
@@ -0,0 +1,22 @@
1
+ <div class="navbar navbar-inverse navbar-fixed-top">
2
+ <div class="navbar-inner">
3
+ <div class="container">
4
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
5
+ <span class="icon-bar"></span>
6
+ <span class="icon-bar"></span>
7
+ <span class="icon-bar"></span>
8
+ </a>
9
+ <a class="brand" href="<%= path "/" %>">Home</a>
10
+ <div class="nav-collapse collapse">
11
+ <ul class="nav">
12
+ <li class="<%= options[:tab] == :api ? 'active' : '' %>"><a href="<%= path "/api/" %>">API</a></li>
13
+ <li class="<%= options[:tab] == :coverage ? 'active' : '' %>"><a href="<%= path "/coverage" %>">Coverage</a></li>
14
+ <li class="<%= options[:tab] == :archive ? 'active' : '' %>"><a href="<%= path "/archive" %>">Archive</a></li>
15
+ <li class="<%= options[:tab] == :release ? 'active' : '' %>"><a href="<%= path "/release_notes" %>">Release Notes</a></li>
16
+ <li class="<%= options[:tab] == :contact ? 'active' : '' %>"><a href="<%= path "/contact" %>">Contact</a></li>
17
+ </ul>
18
+ <%= import "rgen/web/logo.html" %>
19
+ </div><!--/.nav-collapse -->
20
+ </div>
21
+ </div>
22
+ </div>
@@ -0,0 +1,5 @@
1
+ % render "layouts/basic.html", tab: :release do
2
+
3
+ <%= render "#{RGen.root}/doc/history" %>
4
+
5
+ % end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: origen_ahb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0.pre2
5
+ platform: ruby
6
+ authors:
7
+ - Chris P Nappi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-23 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.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: origen_testers
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description:
42
+ email:
43
+ - ra5809@freescale.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - config/application.rb
49
+ - config/commands.rb
50
+ - config/development.rb
51
+ - config/environment.rb
52
+ - config/users.rb
53
+ - config/version.rb
54
+ - lib/origen_ahb.rb
55
+ - lib/origen_ahb/driver.rb
56
+ - lib/origen_ahb/interface.rb
57
+ - lib/origen_ahb/top_level.rb
58
+ - lib/tasks/origen_ahb.rake
59
+ - program/prb1.rb
60
+ - templates/web/archive.md.erb
61
+ - templates/web/contact.md.erb
62
+ - templates/web/index.md.erb
63
+ - templates/web/layouts/_basic.html.erb
64
+ - templates/web/partials/_navbar.html.erb
65
+ - templates/web/release_notes.md.erb
66
+ homepage: http://rgen.freescale.net/origen_ahb
67
+ licenses: []
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: 1.9.3
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 1.8.11
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 2.2.2
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: Protocol layer for AHB protocol (AMBA AHB-lite)
89
+ test_files: []
90
+ has_rdoc: