File: t_embed1.pl

package info (click to toggle)
verilator 3.833-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 10,196 kB
  • sloc: cpp: 49,566; perl: 7,111; yacc: 2,221; lex: 1,702; makefile: 651; sh: 175
file content (51 lines) | stat: -rwxr-xr-x 1,524 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.

use File::Spec;

my $self = $Self;
my $child_dir = "$Self->{obj_dir}_child";
mkdir $child_dir;

# Compile the child
{
    my @cmdargs = $Self->compile_vlt_flags
	(VM_PREFIX => "$Self->{VM_PREFIX}_child",
	 top_filename => "$Self->{name}_child.v",
	 verilator_flags => ["-cc", "-Mdir", "${child_dir}", "--debug-check"],
	);
    
    $Self->_run(logfile=>"${child_dir}/vlt_compile.log",
		cmd=>\@cmdargs);

    $Self->_run(logfile=>"${child_dir}/vlt_gcc.log",
		cmd=>["cd ${child_dir} && ",
		      "make", "-f".getcwd()."/Makefile_obj",
		      "CPPFLAGS_DRIVER=-D".uc($self->{name}),
		      ($opt_verbose ? "CPPFLAGS_DRIVER2=-DTEST_VERBOSE=1":""),
		      "MAKE_MAIN=0",
		      "VM_PREFIX=$self->{VM_PREFIX}_child",
		      "V$self->{name}_child__ALL.a",  # bypass default rule, make archive
		      ($param{make_flags}||""),
		]);
}

# Compile the parent (might be with other than verilator)
compile (
    v_flags2 => [File::Spec->rel2abs("${child_dir}/V$self->{name}_child__ALL.a"),
		 # TODO would be nice to have this in embedded archive
		 "t/t_embed1_c.cpp"],
    );

execute (
    check_finished=>1,
    );

ok(1);
1;