• Guides
  • Videos
  • Publications
  • API
  • Github
  • Community
  • Release Notes
  • Plugins
  • 1 - A Pattern in 20 Minutes
  • 2 - Model Data Import
  • 3 - The Compiler
  • 4 - Creating a Header File
  • 5 - Create Test Program Flow
  • 6 - Create Test Program Tests

Videos

The Compiler


Introduction to some basic features of the Origen compiler.

  • Code
  • Comments

References

  • Full source code on Github
  • Compiler Guide

Code

Templates
# templates/demo/_layout.txt.erb
This is the header

<%= yield %>

This is the footer
# templates/demo/_sub_example.txt.erb
Hello from the sub template!

The value of argx is: <%= options[:argx] %>
# templates/demo/example1.txt.erb
% render "layout.txt" do

Hello from template example 1

10 + 10 = 20

% # This is a Ruby comment, it will not appear in the output

% 10.times do |i|
This is loop <%= i %>
% end

% if 10 == 20
This is the true case
% else 
This is the false case
% end 

<%= render "templates/demo/sub_example.txt", argx: 100 %>

% dut.atd0.regs.each do |name, reg|
<%= name %>
% end

% end
# templates/demo/example2.txt.erb
<%= render "templates/demo/sub_example.txt", argx: 200 %>

Comments

Generated with the Origen Semiconductor Developer's Kit

Origen is released under the terms of the MIT license