Difference between revisions of "Sharing Cadence Libraries"

From Vlsiwiki
Jump to: navigation, search
(Viewing permissions)
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
There are several issues to share libraries in Cadence. First, you must have a unix group made and add the users whom you want to share with added to the group. This is taken care of by your professor for this class.
 
There are several issues to share libraries in Cadence. First, you must have a unix group made and add the users whom you want to share with added to the group. This is taken care of by your professor for this class.
  
=== Changing file group ===
+
=== Viewing permissions ===
  
If you want to change the group ownership of a directory and it's contents recursively, you should use:
+
To see the permissions in a directory, type:
  chgrp -R group_name directory
+
  ls -al
 +
and you will see something like this:
  
If your default group is different than the one you want, you will have to do this whenever a new file is created.
+
total 24
 +
drwx------  2 mrg faculty  4096 May 29 08:08 .
 +
drwxr-xr-x 151 mrg vlsi    12288 May 29 08:08 ..
 +
-rw-rw----  1 mrg faculty  2825 May 29 08:08 hardcopy.0
 +
-rw-rw----  1 mrg faculty  1050 May 29 08:08 hardcopy.1
 +
 
 +
The permissions are ont he left and are:
 +
 
 +
drwxrwxrwx
 +
 
 +
The first character specifies a directory or a file when it is -. Then there are three groupings of "rwx" which are the permissions. A dash (-) means that the permission is not set. The three groups are for the user (u), group (g), and others (o).
 +
 
 +
Note there can be some other special permissions (e.g. s) but that is beyond this tutorial. For further information on permissions, look at this tutorial:
 +
 
 +
http://www.ics.uci.edu/computing/linux/file-security.php
  
 
=== Changing file permissions ===
 
=== Changing file permissions ===
Line 13: Line 28:
  
 
chmod syntax is shown in the following example:
 
chmod syntax is shown in the following example:
  chmod 775 file_name
+
  chmod g+rw file_name
  chmod 775 folder_name
+
  chmod g+rx folder_name
  
Where the series of three digits defines the permissions for user, group, and others.
+
Where the series characters defines the permissions for owner/user (u), group (g), and others (o).  
Each digit indicates what operations can be accessed, depending on the following operation values:
+
Each charater indicates what operations can be accessed, depending on the following operation values:
  1 : Execute
+
  x : Execute
  2 : Write
+
  w : Write
  4 : Read
+
  r : Read
 +
So, g+rw means to add read and write to the group. Similarly, g-rw would subtract read write from the group. You can also do several at a time such as gu+rw to change group and owner. The character a is a shortcut for ugo.
  
So in our above example, the owner has the permission to read/write/execute (4+2+1), the group has the permission to read/write/execute (4+2+1), while others can read/execute only (4+1).  For further information on permissions, look at this tutorial:
+
In case you want to use chmod recursively for files underneath a folder, you could use:
 +
chmod -R g+rwx folder_name
 +
but note that this file permission is just an example!! It is not a good idea to set the permissions as rwx for everything as that is too broad. (Why would you execute a non-binary file?) A better way is to "clone" the group permissions to have the same permissions as the owner then you can do something like this:
  
  http://www.ics.uci.edu/computing/linux/file-security.php
+
  chmod -R g=u folder_name
  
 +
=== Changing group ===
  
In case you want to use chmod recursively for files underneath a folder, you could use:
+
If you want to change the group ownership of a file or directory, you can use:
  chmod -R 751 folder_name
+
  chgrp group_name file_or_dir
but note that this file permission is just an example!! It is not a good idea to set the permissions as 751 for everything as that is too broad.
+
To do this recursively to all subcontents, you can use:
If you want to "clone" the group permissions to have the same permissions as the owner then you can do something like this:
+
chgrp -R group_name directory
  
find folder_name -name \* -exec chmod g=u {} \;
+
If your default group is different than the one you want, you will have to do this whenever a new file is created.
  
 +
=== Changing owner ===
  
== Adding Library ==
+
You probably don't have to do this, but you can change which user owns a file with:
 +
chown user file_or_dir
 +
or recursively with:
 +
chown -R user directory
 +
 
 +
=== Adding Library ===
  
 
To add an existing library from another machine or user, first you have to copy this library to your local space (where you run virtuoso), then in your cds.lib file you should add:
 
To add an existing library from another machine or user, first you have to copy this library to your local space (where you run virtuoso), then in your cds.lib file you should add:
Line 43: Line 68:
 
  DEFINE new_library /your/local/space/new_library
 
  DEFINE new_library /your/local/space/new_library
 
  ASSIGN new_library libMode shared
 
  ASSIGN new_library libMode shared
 
  
  

Latest revision as of 15:27, 29 May 2014

There are several issues to share libraries in Cadence. First, you must have a unix group made and add the users whom you want to share with added to the group. This is taken care of by your professor for this class.

Viewing permissions

To see the permissions in a directory, type:

ls -al

and you will see something like this:

total 24
drwx------   2 mrg faculty  4096 May 29 08:08 .
drwxr-xr-x 151 mrg vlsi    12288 May 29 08:08 ..
-rw-rw----   1 mrg faculty  2825 May 29 08:08 hardcopy.0
-rw-rw----   1 mrg faculty  1050 May 29 08:08 hardcopy.1

The permissions are ont he left and are:

drwxrwxrwx

The first character specifies a directory or a file when it is -. Then there are three groupings of "rwx" which are the permissions. A dash (-) means that the permission is not set. The three groups are for the user (u), group (g), and others (o).

Note there can be some other special permissions (e.g. s) but that is beyond this tutorial. For further information on permissions, look at this tutorial:

http://www.ics.uci.edu/computing/linux/file-security.php

Changing file permissions

If you want to change the permission on a file or directory, you should use use chmod.

chmod syntax is shown in the following example:

chmod g+rw file_name
chmod g+rx folder_name

Where the series characters defines the permissions for owner/user (u), group (g), and others (o). Each charater indicates what operations can be accessed, depending on the following operation values:

x : Execute
w : Write
r : Read

So, g+rw means to add read and write to the group. Similarly, g-rw would subtract read write from the group. You can also do several at a time such as gu+rw to change group and owner. The character a is a shortcut for ugo.

In case you want to use chmod recursively for files underneath a folder, you could use:

chmod -R g+rwx folder_name

but note that this file permission is just an example!! It is not a good idea to set the permissions as rwx for everything as that is too broad. (Why would you execute a non-binary file?) A better way is to "clone" the group permissions to have the same permissions as the owner then you can do something like this:

chmod -R g=u folder_name

Changing group

If you want to change the group ownership of a file or directory, you can use:

chgrp group_name file_or_dir

To do this recursively to all subcontents, you can use:

chgrp -R group_name directory

If your default group is different than the one you want, you will have to do this whenever a new file is created.

Changing owner

You probably don't have to do this, but you can change which user owns a file with:

chown user file_or_dir

or recursively with:

chown -R user directory

Adding Library

To add an existing library from another machine or user, first you have to copy this library to your local space (where you run virtuoso), then in your cds.lib file you should add:

DEFINE new_library /your/local/space/new_library

Then in your lib.defs file you should add:

DEFINE new_library /your/local/space/new_library
ASSIGN new_library libMode shared


Copying between libraries

DO NOT COPY CADENCE FILES IN UNIX. This could render your project unusable. Instead, you should use the "Copy Wizard" available via Edit->Copy Wizard in the CIW window. I suggest that you have a shared library and work on files in a local library. When you are ready to share, copy them to the shared library and fix the permissions.