Is it unethical writing two papers addressing two aspects of the same research project
Is it unethical writing two papers addressing two aspects of the same research project


Not necessarily. However, the following would be unethical:


Submitting two papers with any overlapping material without one citing the other and explaining the parts that overlap (giving credit to where the idea was originally proposed)
Submitting essentially the same idea to two different venues at the same time (farming to see if one of them gets accepted)
Submitting two papers with exactly the same idea, but making it sound like they are two different ideas


Basically the rule of thumb here is: be honest. It is fine to split an idea across multiple papers; my advisor has suggested doing this a few times, and it's worked out well. But if you are doing anything to mislead the reviewers, then you have a problem of misconduct.


  I have realized that, the systematic framework I have applied in Paper 1 can be a more generic framework, applying to different scenarios for different application purposes...I have written another Paper 2 discussing this generality aspect of the framework, with the simplified yet slightly different experimental setting as a case study for the framework.


Congratulations on this realization!
This sounds like a significant advancement over your Paper 1, and it constitutes research progress. So there is no ethical issue with writing the second paper.


  Also, while paper 1's still under review, I have submitted an ArXiv preprint. All similarities in paper 2 compared to paper 1 are properly cited, noted and discussed if necessary, when writing paper 2.


Great! It sounds like you have already taken the right steps here.


  So the question is, is it OK to have this paper 2 submitted to another conference (an automation conference vs. the previous cs one) for review? Is paper 2 considered to be an "unethical salami slicing"?


It is OK, since you have cited paper 1 and made it clear this builds on it. Now, it is up to the reviewers to decide whether it is too much overlap to be novel. You may find that the reviewers love the idea, or maybe they will say it's not clear to them how it is an advancement over paper 1. Either way, it is perfectly ethical to submit and see what they think, assuming you have been honest and professional.



For comparison, here are some examples of ethical behavior (roughly taken from experience):


We have a new idea, which we write up in Paper A and submit as an invited contribution. At the same time, we are working on an application that uses the idea from A, and in order to make the paper self-contained we need to explain some things about that idea. We write Paper B which applies the idea, and we put Paper A on arXiv and cite it in Paper B. Paper B has a section on the new idea and explains clearly that this idea was originally proposed in Paper A.
We have a paper which is too long and needs better motivation, so we decide to split it into two papers instead as part of the paper is not really helping the reviewers like it anyway. We write Paper A which basically contains the bulk of the original paper minus one section which studies a particular theoretical aspect. Then we write Paper B which studies the theoretical aspect. We rephrase Paper B to only contain the parts that were specific to that aspect, and remove parts related to Paper A, so that the papers no longer have any overlap.