Shell: No such file or directory, but the file exists

Example File:

# File Name : tools.csh

source $PROJ_DIR/scripts/getOS.csh

 

Commands run from terminal:

$> echo $SHELL

tcsh

$> pwd

project1

$> cd work

$> source ../tools.csh

/home/myname/myprojects/project1/scripts/getOS.csh: Command not found

$> ls ../scripts/getOS.sh

../scripts/getOS.sh

$> ls /home/myname/myprojects/project1/scripts/getOS.csh

/home/myname/myprojects/project1/scripts/getOS.csh: No such file or directory

From the above, it seems like, the file exists if accessed using relative path.

Same file is not accessible using absolute path.

 

Fix:

Check $PROJ_DIR path carefully starting from ‘/’

There may be typo making it to point to different path, which results in such errors from Shell.

Compilation error at UVM factory registration macros

package simple_pkg;

import uvm_pkg::*;

`include “uvm_macros.svh”

class my_class extends uvm_object;

`uvm_object_utils(my_class)

function new(string name=””,int additional_arg);

super.new(name);

endfunction

endclass

endpackage

The above package seems to be syntactically correct. But compiler(Eg. Cadence irun) throws error.

Compilation error: `uvm_object_utils(my_class). Task/function call, or property/sequence instance does not specify all required formal arguments.

`uvm_object_utils macro tries to register with factory, where the function new doesn’t have additional args.

Compiler throws error due to ‘additional_arg’ to function new. Remove this and compilation error goes off.

Error message is not clear and seems irrelevant to the issue here – a disadvantage of using macros; the macro expands into something that we can’t visualize.

 

Summary: Avoid additional args to ‘new’ function when using UVM factory registration.