OpenCores
URL https://opencores.org/ocsvn/soc_maker/soc_maker/trunk

Subversion Repositories soc_maker

[/] [soc_maker/] [trunk/] [spec/] [core_inst_spec.rb] - Diff between revs 7 and 8

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 7 Rev 8
Line 132... Line 132...
    o2 = Marshal::load(Marshal.dump(o1))
    o2 = Marshal::load(Marshal.dump(o1))
    o2.params[ :param1 ] = 1
    o2.params[ :param1 ] = 1
    ( o2 == o1 ).should be == false
    ( o2 == o1 ).should be == false
  end
  end
 
 
 
 
 
 
   it "should create valid vhdl output with our test library" do
 
 
 
     SOCMaker::conf[ :build_dir ] = 'spec/tmp_build2'
 
     SOCMaker::conf[ :hdl_dir   ] = 'b'
 
     coder = SOCMaker::VHDLCoder.new
 
     SOCMaker::lib.refresh( './spec/test_soc_lib' )
 
     soc = SOCMaker::from_f( './spec/test_soc.yaml' );
 
     SOCMaker::lib.add_core( soc )
 
     soc_inst = SOCMaker::CoreInst.new( 'test_socv1' )
 
     soc_inst.consistency_check
 
     soc_inst.gen_toplevel( coder );
 
    #soc.copy_files
 
    #p soc.cons
 
    #puts soc.to_yaml
 
   end
 
 
 
   it "should call coder functions for each core-def. (stub-version)" do
   it "should call coder functions for each core-def. (stub-version)" do
 
 
     SOCMaker::lib.clear
     SOCMaker::lib.clear
     soc = SOCMaker::SOCDef.new( "test_soc", "v1", "my_soc_top" )
     soc = SOCMaker::SOCDef.new( "test_soc", "v1", "my_soc_top" )
 
 
Line 174... Line 156...
 
 
     coder.stub( :is_a? ){ SOCMaker::VHDLCoder }
     coder.stub( :is_a? ){ SOCMaker::VHDLCoder }
 
 
     coder.stub( :filename ){ |x| x + ".vhd" }
     coder.stub( :filename ){ |x| x + ".vhd" }
 
 
 
     coder.stub( :add_ifc_default_assignment )
 
 
     coder.stub( :add_ifc_connection )
     coder.stub( :add_ifc_connection )
 
 
 
 
     added_cons = {}
     added_cons = {}
Line 195... Line 178...
     core_a = SOCMaker::CoreDef.new( "core_a", "v1", file, "top" )
     core_a = SOCMaker::CoreDef.new( "core_a", "v1", file, "top" )
     core_b = SOCMaker::CoreDef.new( "core_b", "v1", file, "top" )
     core_b = SOCMaker::CoreDef.new( "core_b", "v1", file, "top" )
     SOCMaker::lib.add_core( core_a )
     SOCMaker::lib.add_core( core_a )
     SOCMaker::lib.add_core( core_b )
     SOCMaker::lib.add_core( core_b )
 
 
     ifc_spc = SOCMaker::IfcSpc.new( "myifc", "v1", 'ports' => { port_a: 1, port_b: 0 } )
     ifc_spc = SOCMaker::IfcSpc.new( "myifc", "v1", 'ports' => { port_a: { dir: 1}, port_b: { dir: 0 } } )
     SOCMaker::lib.add_ifc( ifc_spc )
     SOCMaker::lib.add_ifc( ifc_spc )
     ifc_def_1 = SOCMaker::IfcDef.new( "myifc", "v1", 0, { a: SOCMaker::IfcPort.new( "port_a", 1 ) } )
     ifc_def_1 = SOCMaker::IfcDef.new( "myifc", "v1", 0, { a: SOCMaker::IfcPort.new( "port_a", 1 ),
     ifc_def_0 = SOCMaker::IfcDef.new( "myifc", "v1", 1, { b: SOCMaker::IfcPort.new( "port_b", 1 ) } )
                                                           b: SOCMaker::IfcPort.new( "port_b", 1 ) } )
 
 
 
     ifc_def_0 = SOCMaker::IfcDef.new( "myifc", "v1", 1, { a: SOCMaker::IfcPort.new( "port_a", 1 ),
 
                                                           b: SOCMaker::IfcPort.new( "port_b", 1 ) } )
 
 
 
 
     core_a.interfaces[ :ifc_a ] = ifc_def_0
     core_a.interfaces[ :ifc_a ] = ifc_def_0
     core_a.interfaces[ :ifc_b ] = ifc_def_1
     core_a.interfaces[ :ifc_b ] = ifc_def_1
     core_b.interfaces[ :ifc_a ] = ifc_def_0
     core_b.interfaces[ :ifc_a ] = ifc_def_0
Line 247... Line 233...
     added_cons.should be == { a_new_con: { rule: "or", m0: {inst_a: :ifc_a}, m1: {inst_b: :ifc_b } } }
     added_cons.should be == { a_new_con: { rule: "or", m0: {inst_a: :ifc_a}, m1: {inst_b: :ifc_b } } }
     dir_path.should be == dir_path_ref
     dir_path.should be == dir_path_ref
   end
   end
 
 
 
 
 
 
 
 
 
   it "should create valid vhdl output with our test library" do
 
 
 
     SOCMaker::conf[ :build_dir ] = 'spec/tmp_build2'
 
     SOCMaker::conf[ :hdl_dir   ] = 'b'
 
     coder = SOCMaker::VHDLCoder.new
 
     SOCMaker::lib.refresh( './spec/test_soc_lib' )
 
     soc = SOCMaker::from_f( './spec/test_soc.yaml' );
 
     SOCMaker::lib.add_core( soc )
 
     soc_inst = SOCMaker::CoreInst.new( 'test_socv1' )
 
     soc_inst.consistency_check
 
     soc_inst.gen_toplevel( coder );
 
     soc.copy_files
 
    #p soc.cons
 
    #puts soc.to_yaml
 
   end
 
 
end
end
 
 
# vim: noai:ts=2:sw=2
# vim: noai:ts=2:sw=2

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.