origen_link 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 306c1498fc9162b2ece83077890b6d95b10de164
4
- data.tar.gz: 690f3e5f2327610dbddcd084aaff9e160561f4df
2
+ SHA256:
3
+ metadata.gz: cc00ce059d3335148b342e2e419a699602f0d31c5364714bc92bd123ade40f0b
4
+ data.tar.gz: 97c755ea65a9e0d0277975b06d880cfbd7505c21783524b8e2e6c20475771bbc
5
5
  SHA512:
6
- metadata.gz: 5ac38a334bd39ac2e7dcb47098f46a0e1c8db837130a1e2b46921ab62e1b2b3f1bbbcc7e4379011d0d4c5bf665d08791f8773169b31ec5752b7f5ba1ede50ff5
7
- data.tar.gz: a52ee1c7c199bd64f5591d6f4340e0e157670d55099053ab5f3239e7e962ffb9bda96a1a8f568bc7c66edd4632a40d75a5bbd74bd3f95d9fde4bdf2008ee0003
6
+ metadata.gz: 39a7cb3947b427696167ee75fdf89ffdaa6041c5461a3c8d4058a51ff41aafff6e865bf11a92d960abfcc68e3e71d01e3b6ed554bb46aa0276bf958c908ea80b
7
+ data.tar.gz: 2cf6b49393b39d92e9c5c634754cbfcf1c158bad9766c0daaeebce7eec1ceb59ea82164ca7db1311fddb7554bde2abc1a4bfd7f2e0038736dd701ae9b5e42e89
@@ -1,116 +1,116 @@
1
- #!/usr/bin/env ruby
2
- $LOAD_PATH.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib'))
3
- $LOAD_PATH.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '..', 'config'))
4
- require 'socket'
5
- require 'origen_link/server/sequencer'
6
- require 'origen_link/server/jtag'
7
- require 'version'
8
-
9
- # method to handle the processing of a jtag message
10
- def processjtagmessage(message)
11
- reply = 'Error'
12
- if message =~ /jtag_configure:/
13
- # Allow the default io numbers to be overridden
14
- newios = message.gsub(/\s+/, '').split(':')[1].split(',')
15
- if newios.size = 4
16
- $tdiio = newios[0]
17
- $tdoio = newios[1]
18
- $tmsio = newios[2]
19
- $tckio = newios[3]
20
- reply = "jtag_configure: tdi = #{$tdiio}, tdo = #{$tdoio}, tms = #{$tmsio}, tck = #{$tckio}"
21
- else
22
- reply = 'jtag_configure failed, need 4 io numbers, tdi, tdo, tms, tck - in that order'
23
- end
24
- elsif message =~ /jtag_reinit/
25
- $jtag_interpreter.destroy unless $jtag_interpreter.nil?
26
- $jtag_interpreter = OrigenLink::Server::Jtag.new($tdiio, $tdoio, $tmsio, $tckio)
27
- reply = 'done'
28
- else
29
- $jtag_interpreter = OrigenLink::Server::Jtag.new($tdiio, $tdoio, $tmsio, $tckio) if $jtag_interpreter.nil?
30
- reply = $jtag_interpreter.processmessage(message)
31
- end
32
- reply
33
- end
34
-
35
- # General initialization
36
- server = TCPServer.open('', 12_777)
37
- remoteuser = ''
38
- remotehost = ''
39
- sessionactivity = Time.now
40
- sessionactive = false
41
-
42
- # Initialize the pin sequencer object
43
- pinsequencer = OrigenLink::Server::Sequencer.new
44
- pinsequencer.version = OrigenLink::VERSION
45
- puts "server version #{pinsequencer.version} started"
46
-
47
- # Set default values for the Jtag object
48
- $tdiio = 116
49
- $tdoio = 124
50
- $tmsio = 6
51
- $tckio = 119
52
- $jtag_interpreter = nil
53
-
54
- # Wait for connection requests in an infinite loop
55
- loop do
56
- client = server.accept
57
- thisuser = client.gets.chomp
58
- thisremotehost = client.peeraddr[3]
59
-
60
- # for now assume that any session lasting longer than 20 minutes has timed out (will happen if the origen side app is killed or stopped at a breakpoint with no activity)
61
- if (Time.now - sessionactivity) > 1200
62
- sessionactive = false
63
- end
64
-
65
- change_in_user = false
66
-
67
- # if there is no active session running allow one to start
68
- unless sessionactive
69
- #flag any change in host machine or user for collision detection
70
- change_in_user = true unless (remoteuser.eql? thisuser) && (remotehost.eql? thisremotehost)
71
- remoteuser = thisuser
72
- remotehost = thisremotehost
73
- end
74
-
75
- # always return whether or not the user has been changed (for collision detection)
76
- if change_in_user
77
- response = "user_change:user_change\n"
78
- else
79
- response = "\n"
80
- end
81
-
82
- # Now we're ready to process the actual message
83
- # if this connection is from the active user\host machine, then process the information
84
- if (remoteuser.eql? thisuser) && (remotehost.eql? thisremotehost)
85
- while (message = client.gets) != "\n"
86
- # process the message
87
- if message =~ /session_end/ || message =~ /session_kill/
88
- sessionactive = false
89
- response = response + "session_end:session_end\n"
90
- elsif message[0,5] == 'jtag_'
91
- # jtag messages get routed to the jtag message handler
92
- sessionactive = true
93
- response = response + processjtagmessage(message.chomp) + "\n"
94
- else
95
- # default is pin sequencer message handling
96
- sessionactive = true
97
- response = response + pinsequencer.processmessage(message.chomp) + "\n"
98
- end
99
- end
100
- sessionactivity = Time.now
101
- else
102
- # The connection didn't come from the active user. Only session_kill is allowed.
103
- checkmessage = client.gets.chomp
104
- if checkmessage =~ /session_kill/
105
- sessionactive = false
106
- response = response + "Terminated: session from #{remoteuser} at IP address #{remotehost} inactive for #{Time.now - sessionactivity} seconds has been killed\n"
107
- change_in_user = true unless (remoteuser.eql? thisuser) && (remotehost.eql? thisremotehost)
108
- remoteuser = thisuser
109
- remotehost = thisremotehost
110
- else
111
- response = response + "Busy: server is in use by #{remoteuser} from IP address #{remotehost}\n"
112
- end
113
- end
114
- client.write(response)
115
- client.close
116
- end
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib'))
3
+ $LOAD_PATH.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '..', 'config'))
4
+ require 'socket'
5
+ require 'origen_link/server/sequencer'
6
+ require 'origen_link/server/jtag'
7
+ require 'version'
8
+
9
+ # method to handle the processing of a jtag message
10
+ def processjtagmessage(message)
11
+ reply = 'Error'
12
+ if message =~ /jtag_configure:/
13
+ # Allow the default io numbers to be overridden
14
+ newios = message.gsub(/\s+/, '').split(':')[1].split(',')
15
+ if newios.size = 4
16
+ $tdiio = newios[0]
17
+ $tdoio = newios[1]
18
+ $tmsio = newios[2]
19
+ $tckio = newios[3]
20
+ reply = "jtag_configure: tdi = #{$tdiio}, tdo = #{$tdoio}, tms = #{$tmsio}, tck = #{$tckio}"
21
+ else
22
+ reply = 'jtag_configure failed, need 4 io numbers, tdi, tdo, tms, tck - in that order'
23
+ end
24
+ elsif message =~ /jtag_reinit/
25
+ $jtag_interpreter.destroy unless $jtag_interpreter.nil?
26
+ $jtag_interpreter = OrigenLink::Server::Jtag.new($tdiio, $tdoio, $tmsio, $tckio)
27
+ reply = 'done'
28
+ else
29
+ $jtag_interpreter = OrigenLink::Server::Jtag.new($tdiio, $tdoio, $tmsio, $tckio) if $jtag_interpreter.nil?
30
+ reply = $jtag_interpreter.processmessage(message)
31
+ end
32
+ reply
33
+ end
34
+
35
+ # General initialization
36
+ server = TCPServer.open('', 12_777)
37
+ remoteuser = ''
38
+ remotehost = ''
39
+ sessionactivity = Time.now
40
+ sessionactive = false
41
+
42
+ # Initialize the pin sequencer object
43
+ pinsequencer = OrigenLink::Server::Sequencer.new
44
+ pinsequencer.version = OrigenLink::VERSION
45
+ puts "server version #{pinsequencer.version} started"
46
+
47
+ # Set default values for the Jtag object
48
+ $tdiio = 116
49
+ $tdoio = 124
50
+ $tmsio = 6
51
+ $tckio = 119
52
+ $jtag_interpreter = nil
53
+
54
+ # Wait for connection requests in an infinite loop
55
+ loop do
56
+ client = server.accept
57
+ thisuser = client.gets.chomp
58
+ thisremotehost = client.peeraddr[3]
59
+
60
+ # for now assume that any session lasting longer than 20 minutes has timed out (will happen if the origen side app is killed or stopped at a breakpoint with no activity)
61
+ if (Time.now - sessionactivity) > 1200
62
+ sessionactive = false
63
+ end
64
+
65
+ change_in_user = false
66
+
67
+ # if there is no active session running allow one to start
68
+ unless sessionactive
69
+ #flag any change in host machine or user for collision detection
70
+ change_in_user = true unless (remoteuser.eql? thisuser) && (remotehost.eql? thisremotehost)
71
+ remoteuser = thisuser
72
+ remotehost = thisremotehost
73
+ end
74
+
75
+ # always return whether or not the user has been changed (for collision detection)
76
+ if change_in_user
77
+ response = "user_change:user_change\n"
78
+ else
79
+ response = "\n"
80
+ end
81
+
82
+ # Now we're ready to process the actual message
83
+ # if this connection is from the active user\host machine, then process the information
84
+ if (remoteuser.eql? thisuser) && (remotehost.eql? thisremotehost)
85
+ while (message = client.gets) != "\n"
86
+ # process the message
87
+ if message =~ /session_end/ || message =~ /session_kill/
88
+ sessionactive = false
89
+ response = response + "session_end:session_end\n"
90
+ elsif message[0,5] == 'jtag_'
91
+ # jtag messages get routed to the jtag message handler
92
+ sessionactive = true
93
+ response = response + processjtagmessage(message.chomp) + "\n"
94
+ else
95
+ # default is pin sequencer message handling
96
+ sessionactive = true
97
+ response = response + pinsequencer.processmessage(message.chomp) + "\n"
98
+ end
99
+ end
100
+ sessionactivity = Time.now
101
+ else
102
+ # The connection didn't come from the active user. Only session_kill is allowed.
103
+ checkmessage = client.gets.chomp
104
+ if checkmessage =~ /session_kill/
105
+ sessionactive = false
106
+ response = response + "Terminated: session from #{remoteuser} at IP address #{remotehost} inactive for #{Time.now - sessionactivity} seconds has been killed\n"
107
+ change_in_user = true unless (remoteuser.eql? thisuser) && (remotehost.eql? thisremotehost)
108
+ remoteuser = thisuser
109
+ remotehost = thisremotehost
110
+ else
111
+ response = response + "Busy: server is in use by #{remoteuser} from IP address #{remotehost}\n"
112
+ end
113
+ end
114
+ client.write(response)
115
+ client.close
116
+ end
@@ -1,109 +1,109 @@
1
- require 'origen'
2
- class OrigenLinkApplication < 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 = "origen_link"
10
- self.namespace = "OrigenLink"
11
- config.name = "origen_link"
12
- config.initials = "OrigenLink"
13
- # Change this to point to the revision control repository for this application
14
- config.rc_url = "git@github.com:Origen-SDK/OrigenLink.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 = "/path/to/server/origen_link"
20
- #config.web_domain = "http://origen.mycompany.net/origen_link"
21
- config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/OrigenLink"
22
- config.web_domain = "http://origen-sdk.org/OrigenLink"
23
-
24
- # When false Origen will be less strict about checking for some common coding errors,
25
- # it is recommended that you leave this to true for better feedback and easier debug.
26
- # This will be the default setting in Origen v3.
27
- config.strict_errors = true
28
-
29
- # See: http://origen-sdk.org/origen/latest/guides/utilities/lint/
30
- config.lint_test = {
31
- # Require the lint tests to pass before allowing a release to proceed
32
- run_on_tag: true,
33
- # Auto correct violations where possible whenever 'origen lint' is run
34
- auto_correct: true,
35
- # Limit the testing for large legacy applications
36
- #level: :easy,
37
- # Run on these directories/files by default
38
- #files: ["lib", "config/application.rb"],
39
- }
40
-
41
- config.semantically_version = true
42
-
43
- config.shared = {
44
- command_launcher: 'config/shared_commands.rb'
45
- }
46
-
47
- # An example of how to set application specific LSF parameters
48
- #config.lsf.project = "msg.te"
49
-
50
- # An example of how to specify a prefix to add to all generated patterns
51
- #config.pattern_prefix = "nvm"
52
-
53
- # An example of how to add header comments to all generated patterns
54
- #config.pattern_header do
55
- # cc "This is a pattern created by the example origen application"
56
- #end
57
-
58
- # By default all generated output will end up in ./output.
59
- # Here you can specify an alternative directory entirely, or make it dynamic such that
60
- # the output ends up in a setup specific directory.
61
- #config.output_directory do
62
- # "#{Origen.root}/output/#{$dut.class}"
63
- #end
64
-
65
- # Similarly for the reference files, generally you want to setup the reference directory
66
- # structure to mirror that of your output directory structure.
67
- #config.reference_directory do
68
- # "#{Origen.root}/.ref/#{$dut.class}"
69
- #end
70
-
71
- # This will automatically deploy your documentation after every tag
72
- #def after_release_email(tag, note, type, selector, options)
73
- # command = "origen web compile --remote --api"
74
- # Dir.chdir Origen.root do
75
- # system command
76
- # end
77
- #end
78
-
79
- # Ensure that all tests pass before allowing a release to continue
80
- #def validate_release
81
- # if !system("origen specs") || !system("origen examples")
82
- # puts "Sorry but you can't release with failing tests, please fix them and try again."
83
- # exit 1
84
- # else
85
- # puts "All tests passing, proceeding with release process!"
86
- # end
87
- #end
88
-
89
- # To enabled source-less pattern generation create a class (for example PatternDispatcher)
90
- # to generate the pattern. This should return false if the requested pattern has been
91
- # dispatched, otherwise Origen will proceed with looking up a pattern source as normal.
92
- #def before_pattern_lookup(requested_pattern)
93
- # PatternDispatcher.new.dispatch_or_return(requested_pattern)
94
- #end
95
-
96
- # If you use pattern iterators you may come across the case where you request a pattern
97
- # like this:
98
- # origen g example_pat_b0.atp
99
- #
100
- # However it cannot be found by Origen since the pattern name is actually example_pat_bx.atp
101
- # In the case where the pattern cannot be found Origen will pass the name to this translator
102
- # if it exists, and here you can make any substitutions to help Origen find the file you
103
- # want. In this example any instances of _b\d, where \d means a number, are replaced by
104
- # _bx.
105
- #config.pattern_name_translator do |name|
106
- # name.gsub(/_b\d/, "_bx")
107
- #end
108
-
109
- end
1
+ require 'origen'
2
+ class OrigenLinkApplication < 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 = "origen_link"
10
+ self.namespace = "OrigenLink"
11
+ config.name = "origen_link"
12
+ config.initials = "OrigenLink"
13
+ # Change this to point to the revision control repository for this application
14
+ config.rc_url = "git@github.com:Origen-SDK/OrigenLink.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 = "/path/to/server/origen_link"
20
+ #config.web_domain = "http://origen.mycompany.net/origen_link"
21
+ config.web_directory = "git@github.com:Origen-SDK/Origen-SDK.github.io.git/OrigenLink"
22
+ config.web_domain = "http://origen-sdk.org/OrigenLink"
23
+
24
+ # When false Origen will be less strict about checking for some common coding errors,
25
+ # it is recommended that you leave this to true for better feedback and easier debug.
26
+ # This will be the default setting in Origen v3.
27
+ config.strict_errors = true
28
+
29
+ # See: http://origen-sdk.org/origen/latest/guides/utilities/lint/
30
+ config.lint_test = {
31
+ # Require the lint tests to pass before allowing a release to proceed
32
+ run_on_tag: true,
33
+ # Auto correct violations where possible whenever 'origen lint' is run
34
+ auto_correct: true,
35
+ # Limit the testing for large legacy applications
36
+ #level: :easy,
37
+ # Run on these directories/files by default
38
+ #files: ["lib", "config/application.rb"],
39
+ }
40
+
41
+ config.semantically_version = true
42
+
43
+ config.shared = {
44
+ command_launcher: 'config/shared_commands.rb'
45
+ }
46
+
47
+ # An example of how to set application specific LSF parameters
48
+ #config.lsf.project = "msg.te"
49
+
50
+ # An example of how to specify a prefix to add to all generated patterns
51
+ #config.pattern_prefix = "nvm"
52
+
53
+ # An example of how to add header comments to all generated patterns
54
+ #config.pattern_header do
55
+ # cc "This is a pattern created by the example origen application"
56
+ #end
57
+
58
+ # By default all generated output will end up in ./output.
59
+ # Here you can specify an alternative directory entirely, or make it dynamic such that
60
+ # the output ends up in a setup specific directory.
61
+ #config.output_directory do
62
+ # "#{Origen.root}/output/#{$dut.class}"
63
+ #end
64
+
65
+ # Similarly for the reference files, generally you want to setup the reference directory
66
+ # structure to mirror that of your output directory structure.
67
+ #config.reference_directory do
68
+ # "#{Origen.root}/.ref/#{$dut.class}"
69
+ #end
70
+
71
+ # This will automatically deploy your documentation after every tag
72
+ #def after_release_email(tag, note, type, selector, options)
73
+ # command = "origen web compile --remote --api"
74
+ # Dir.chdir Origen.root do
75
+ # system command
76
+ # end
77
+ #end
78
+
79
+ # Ensure that all tests pass before allowing a release to continue
80
+ #def validate_release
81
+ # if !system("origen specs") || !system("origen examples")
82
+ # puts "Sorry but you can't release with failing tests, please fix them and try again."
83
+ # exit 1
84
+ # else
85
+ # puts "All tests passing, proceeding with release process!"
86
+ # end
87
+ #end
88
+
89
+ # To enabled source-less pattern generation create a class (for example PatternDispatcher)
90
+ # to generate the pattern. This should return false if the requested pattern has been
91
+ # dispatched, otherwise Origen will proceed with looking up a pattern source as normal.
92
+ #def before_pattern_lookup(requested_pattern)
93
+ # PatternDispatcher.new.dispatch_or_return(requested_pattern)
94
+ #end
95
+
96
+ # If you use pattern iterators you may come across the case where you request a pattern
97
+ # like this:
98
+ # origen g example_pat_b0.atp
99
+ #
100
+ # However it cannot be found by Origen since the pattern name is actually example_pat_bx.atp
101
+ # In the case where the pattern cannot be found Origen will pass the name to this translator
102
+ # if it exists, and here you can make any substitutions to help Origen find the file you
103
+ # want. In this example any instances of _b\d, where \d means a number, are replaced by
104
+ # _bx.
105
+ #config.pattern_name_translator do |name|
106
+ # name.gsub(/_b\d/, "_bx")
107
+ #end
108
+
109
+ end