Class: CLKInfElm
- Inherits:
-
InfElm
- Object
- AxiTdl::SdlModuleActiveBaseElm
- BaseElm
- InfElm
- CLKInfElm
- Defined in:
- lib/tdl/elements/originclass.rb,
lib/tdl/elements/originclass.rb
Overview
clock_reset_taps
Instance Attribute Summary collapse
-
#clock ⇒ Object
Returns the value of attribute clock.
-
#origin_freqM ⇒ Object
Returns the value of attribute origin_freqM.
-
#reset ⇒ Object
Returns the value of attribute reset.
Attributes inherited from InfElm
Attributes inherited from BaseElm
Instance Method Summary collapse
- #check_freqM ⇒ Object
- #clock_reset_taps(def_clock_name, def_reset_name, self_clock, self_reset) ⇒ Object
- #freq_align_signal ⇒ Object
- #freqM ⇒ Object
- #FreqM ⇒ Object
-
#initialize(clock: nil, reset: nil, dimension: [], freqM: nil) ⇒ CLKInfElm
constructor
A new instance of CLKInfElm.
- #intf_def_freqM ⇒ Object
- #use_which_freq_when_copy(argv_clock, argv_origin) ⇒ Object
Methods inherited from InfElm
#[], #dimension_num, #draw, inherited, #inst_port, parse_ports, #port_length, same_name_socket, #signal, subclass
Methods inherited from BaseElm
#matrix, #name_copy, #path_refs, recfg_nc, #s, #signal
Methods included from TdlSpace::ExCreateTP
Methods included from AxiTdl::TestUnitTrack
Constructor Details
#initialize(clock: nil, reset: nil, dimension: [], freqM: nil) ⇒ CLKInfElm
Returns a new instance of CLKInfElm.
585 586 587 588 589 590 591 592 593 |
# File 'lib/tdl/elements/originclass.rb', line 585 def initialize(clock:nil,reset:nil,dimension:[],freqM:nil) # super(dimension:dimension,clock:clock,reset:reset,freqM:freqM) super(dimension:dimension) @clock = clock @reset = reset @origin_freqM = freqM check_freqM end |
Instance Attribute Details
#clock ⇒ Object
Returns the value of attribute clock.
584 585 586 |
# File 'lib/tdl/elements/originclass.rb', line 584 def clock @clock end |
#origin_freqM ⇒ Object
Returns the value of attribute origin_freqM.
584 585 586 |
# File 'lib/tdl/elements/originclass.rb', line 584 def origin_freqM @origin_freqM end |
#reset ⇒ Object
Returns the value of attribute reset.
584 585 586 |
# File 'lib/tdl/elements/originclass.rb', line 584 def reset @reset end |
Instance Method Details
#check_freqM ⇒ Object
628 629 630 631 632 633 634 |
# File 'lib/tdl/elements/originclass.rb', line 628 def check_freqM if @origin_freqM && @clock.is_a?(Clock) if @origin_freqM != @clock.freqM raise TdlError.new("Interface origin clock freqM[#{@origin_freqM}Mhz] dont eql CLOCK freqM[#{@clock.freqM}Mhz]") end end end |
#clock_reset_taps(def_clock_name, def_reset_name, self_clock, self_reset) ⇒ Object
652 653 654 655 656 657 658 659 660 661 662 |
# File 'lib/tdl/elements/originclass.rb', line 652 def clock_reset_taps(def_clock_name,def_reset_name,self_clock,self_reset) new_clk = belong_to_module.logic.clock(self.FreqM) - def_clock_name new_reset = belong_to_module.logic.reset('low') - def_reset_name belong_to_module.Assign do new_clk <= self_clock new_reset <= self_reset end [new_clk,new_reset] end |
#freq_align_signal ⇒ Object
615 616 617 618 619 620 621 622 |
# File 'lib/tdl/elements/originclass.rb', line 615 def freq_align_signal data = freqM if data align_signal(data) else align_signal( 1.11 ) end end |
#freqM ⇒ Object
595 596 597 598 599 600 601 602 603 |
# File 'lib/tdl/elements/originclass.rb', line 595 def freqM if @clock.is_a?(Clock) @clock.freqM elsif @origin_freqM @origin_freqM else nil end end |
#FreqM ⇒ Object
624 625 626 |
# File 'lib/tdl/elements/originclass.rb', line 624 def FreqM() "#{@name}.FreqM".to_nq end |
#intf_def_freqM ⇒ Object
605 606 607 608 609 610 611 612 613 |
# File 'lib/tdl/elements/originclass.rb', line 605 def intf_def_freqM if @clock.is_a?(Clock) @clock.freqM elsif @origin_freqM @origin_freqM else 1.11 end end |
#use_which_freq_when_copy(argv_clock, argv_origin) ⇒ Object
636 637 638 639 640 641 642 643 644 645 646 |
# File 'lib/tdl/elements/originclass.rb', line 636 def use_which_freq_when_copy(argv_clock,argv_origin) if argv_clock == @clock && @clock @origin_freqM elsif argv_clock != @clock && argv_clock.is_a?(Clock) argv_clock.freqM elsif !(argv_clock.is_a?(Clock)) && argv_origin argv_origin else nil end end |