os-fpga/FOEDAG

add_design_file/add_constraint creates new file if it doesn't exists

KochynVolodymyr opened this issue · 5 comments

Describe the bug
add design file from the GUI console creates file if it doesn't exist.

To Reproduce

  • Open FOEDAG
  • run the console:
    ** create_design asd
    ** add_design_file asd.v

Expected behavior
Command should show error if file doesn't exists. No new created file.

checked commit: 3329563

@KochynVolodymyr, no it should not.
Project folder is Foedag specific. Design files are part of the Design. The Design can be run outside Foedag by other tools (Simulators....) and has a directory structure which is managed by the user. They choose the directory structure of the design, it has nothing to do with the tool (Foedag).

I'm not agree, it is not logically. When we create new design at the same time we create folder structure for this design. It is more logically that new created file appears inside this folder.

@alain-rs here is some misunderstanding. Command add_design_file creates new file if it doesn't exists. And new file is created outside the project folder. So, is this correct behavior? If yes, I'll close this bug.

I thing the problem is here:
In 99% of the case, the design already exists and has been created by the user. They used vi, emacs, whatever editor and the design already is running in another tool (Simulator, competitive synthesis tool).
Only in 1%, the user will use Foedag to create the design.

So all the design definition commands are really "import" commands. add_design_file is adding a file to the project, it is not supposed to create a file. It is actually supposed to error out if the file does not exist.

What you mean is "create_design_file" command that does not exist yet. From the GUI, you should distinguish adding and creating.

Got it!